Re: PL/pgSQL PERFORM with CTE - Mailing list pgsql-hackers

From Marko Tiikkaja
Subject Re: PL/pgSQL PERFORM with CTE
Date
Msg-id [email protected]
Whole thread Raw
In response to Re: PL/pgSQL PERFORM with CTE  (Pavel Stehule <[email protected]>)
Responses Re: PL/pgSQL PERFORM with CTE
List pgsql-hackers
On 8/20/13 2:21 PM, Pavel Stehule wrote:
> 2013/8/20 David E. Wheeler <[email protected]>
>> Well, there ought to be *some* way to tell PL/pgSQL to discard the result.
>> Right now I am adding a variable to select into but never otherwise use.
>> Inelegant, IMHO. Perhaps I’m missing some other way to do it?
>>
>> If so, it would help if the hint suggesting the use of PERFORM pointed to
>> such alternatives.
>>
>
> postgres=# DO $$
>   BEGIN
>     PERFORM * FROM (WITH now AS (SELECT now())
>    SELECT * from now) x;
>   END;
> $$;
> DO

.. which doesn't work if you want to use table-modifying CTEs.


Regards,
Marko Tiikkaja




pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: PL/pgSQL PERFORM with CTE
Next
From: Pavel Stehule
Date:
Subject: Re: PL/pgSQL PERFORM with CTE