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

From Pavel Stehule
Subject Re: PL/pgSQL PERFORM with CTE
Date
Msg-id CAFj8pRC2n5wTYn7=1Fz7uNVYpX4pAi3FXV=8yM5SXtxH02gbsg@mail.gmail.com
Whole thread Raw
In response to Re: PL/pgSQL PERFORM with CTE  ("David E. Wheeler" <david@justatheory.com>)
Responses Re: PL/pgSQL PERFORM with CTE  (Marko Tiikkaja <marko@joh.to>)
Re: PL/pgSQL PERFORM with CTE  ("David E. Wheeler" <david@justatheory.com>)
List pgsql-hackers



2013/8/20 David E. Wheeler <david@justatheory.com>
On Aug 20, 2013, at 2:41 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:

> yes, in this context you should not use a PERFORM
>
> PL/pgSQL protect you before useless queries - so you can use a CTE without returned result directly or CTE with result via PERFORM statement (and in this case it must be unmodifing CTE).
>
> Sorry, I don't see any problem - why you return some from CTE and then you throw this result?

I am passing the values returned from a CTE to a call to pg_notify(). I do not care to collect the output of pg_notify(), which returns VOID.

it is little bit different issue - PL/pgSQL doesn't check if returned type is VOID - it can be allowed, I am thinking. So check of empty result can be enhanced.

Regards

Pavel
 

Best,

David


pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])
Next
From: Marko Tiikkaja
Date:
Subject: Re: PL/pgSQL PERFORM with CTE