Re: Declaring arrays in plpgsql functions

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Declaring arrays in plpgsql functions
Дата
Msg-id 24133.1017085022@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Declaring arrays in plpgsql functions  (Daniel Lundin <daniel@helena-daniel.se>)
Ответы Re: Declaring arrays in plpgsql functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Daniel Lundin <daniel@helena-daniel.se> writes:
> I'm trying to convert rows from a table into a two dimensional array, and
> thought I could do so in a plpgsql function, but I can't declare the return
> variable as an array:

The declaration is fine (at least it works for me, in 7.2).  The trouble
is with:

>         text[array_dim(text) + 1][0] := rs.src;
>         text[array_dim(text) + 1][1] := rs.id;

plpgsql doesn't support assigning to array elements :-(.  (Even if it
did, you couldn't use array_dims() like that --- array_dims() returns
a string.)
        regards, tom lane


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Marin Dimitrov"
Дата:
Сообщение: Re: 16 parameter
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Declaring arrays in plpgsql functions