On Sun, Mar 6, 2011 at 14:29, <depstein(at)alliedtesting(dot)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’t
> 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';