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

Поиск
Список
Период
Сортировка
От Vik Reykja
Тема Re: Can't use WITH in a PERFORM query in PL/pgSQL?
Дата
Msg-id AANLkTikjz_sCg_KjTLyyjFcMEy2D=t=bG0Ju98Jsu_-E@mail.gmail.com
обсуждение исходный текст
Ответ на Can't use WITH in a PERFORM query in PL/pgSQL?  (<depstein@alliedtesting.com>)
Список pgsql-bugs
On Sun, Mar 6, 2011 at 14:29, <depstein@alliedtesting.com> wrote:

> The only workaround that I can think of is to use a dummy variable to
> capture the query result. This has to be done even when the query doesn=
=E2=80=99t
> have a result (as when calling a function returning void).
>
>
>
> do
>
> $$declare
>
> dummy record;
>
> begin
>
> with A as (select 1 as foo)
>
> select foo into dummy from A;
>
> end$$;
>
>
Or use parentheses:

do $$
begin
    perform (with A as (select 1 as foo)
             select foo from A);
end;
$$ language 'plpgsql';

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

Предыдущее
От:
Дата:
Сообщение: Can't use WITH in a PERFORM query in PL/pgSQL?
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: BUG #5915: OldSerXidAdd inflates pg_serial too much