Re: Can't use WITH in a PERFORM query in PL/pgSQL?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: Can't use WITH in a PERFORM query in PL/pgSQL?
Дата
Msg-id AANLkTi=9G5Uoc1gG0poqE-pZbBMr+1JBbuHNPp+rq0b3@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Can't use WITH in a PERFORM query in PL/pgSQL?  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-bugs
On Thu, Mar 24, 2011 at 10:36 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> Hello
>
> why you can do it?
>
> please, try to RETURN QUERY ...
>
> Regards
>
> Pavel Stehule
>
>
>>
>> $$begin
>>
>> perform(
>>
>> with A as (select generate_series(1,3) as foo)
>>
>> select foo from A
>>
>> );
>>
>> end$$;

This is 'DO' statement.  Also I think this is legitimate bug:

you can do perform func(foo_id) from something;

but not

with something as (something)
perform func(foo_id) from something;

this might do as workaround:
do
$$begin
perform(
with A as (select 1 as foo)
select array(select foo from A)
);
end$$;

merlin

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

Предыдущее
От: "Nathan M. Davalos"
Дата:
Сообщение: Re: BUG #5944: COPY FROM doesn't work with international characters
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Service Wont Start