Re: pl/pgsql and arrays[]

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: pl/pgsql and arrays[]
Дата
Msg-id CAFj8pRB2Kp_2SdXJ2-8KgEx46=6aJW5Nk1TMCT8ht5DEXCHdKA@mail.gmail.com
обсуждение исходный текст
Ответ на pl/pgsql and arrays[]  (Maxim Boguk <maxim.boguk@gmail.com>)
Ответы Re: pl/pgsql and arrays[]
Список pgsql-general
Hello

it work on my pc

postgres=# \sf fx
CREATE OR REPLACE FUNCTION public.fx()
 RETURNS SETOF integer
 LANGUAGE plpgsql
AS $function$ declare g int[] = '{20}';
begin
  return next g[1];
  return;
end;
$function$
postgres=# select fx();
 fx
----
 20
(1 row)

regards

Pavel Stehule

2011/12/5 Maxim Boguk <maxim.boguk@gmail.com>:
> Some quetions about pl/pgsql and arrays[].
>
> Is such constructions as:
>
> RETURN NEXT array[1];
>
> OR
>
> SELECT val INTO array[1] FROM ...;
>
> Should not work?
>
> At least documentation about RETURN NEXT  says:
> "RETURN NEXT expression;"
>
> I think array[1] is a valid expression.
>
> --
> Maxim Boguk
> Senior Postgresql DBA.

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

Предыдущее
От: Maxim Boguk
Дата:
Сообщение: Re: WITH and WITH RECURSIVE in single query
Следующее
От: Maxim Boguk
Дата:
Сообщение: Re: pl/pgsql and arrays[]