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

From Merlin Moncure
Subject Re: PL/pgSQL PERFORM with CTE
Date
Msg-id CAHyXU0yxk11Y0Ov=+TKHZmvtuDjA+FaVv1sYctTuD0durddMpg@mail.gmail.com
Whole thread Raw
In response to Re: PL/pgSQL PERFORM with CTE  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: PL/pgSQL PERFORM with CTE  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
On Fri, Aug 23, 2013 at 1:38 PM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
>
>
>
> 2013/8/23 Merlin Moncure <mmoncure@gmail.com>
> I think so is not good if some programming language functionality does one
> in one context (functions) and does something else in second context
> (procedures).

It's not really different -- it means 'return if able'.  Also there
are a lot of things that would have to be different for other reasons
especially transaction management.  It's not reasonable to expect same
behavior in function vs procedure context -- especially in terms of
sending output to the caller.

> On second hand, I am thinking so requirement PERFORM is good. A query that
> does some, but result is ignored, is strange (and it can be a performance
> fault), so we should not be too friendly in this use case.

Completely disagree.  There are many cases where this is *not*
strange. For example:
SELECT writing_func(some_col) FROM foo;

merlin



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: PL/pgSQL PERFORM with CTE
Next
From: Pavel Stehule
Date:
Subject: Re: Performance problem in PLPgSQL