Re: PL/pgSQL 1.2 - Mailing list pgsql-hackers

From Joel Jacobson
Subject Re: PL/pgSQL 1.2
Date
Msg-id CAASwCXeJL=rVt0Vfc7=4E+YG86k+fZsCgiodDGxNjnXr+qD79A@mail.gmail.com
Whole thread Raw
In response to Re: PL/pgSQL 1.2  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: PL/pgSQL 1.2
List pgsql-hackers
On Thu, Sep 4, 2014 at 11:07 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:
> it is different semantic - returns composite or set of composites  --- it is
> not row or rows

The point was, RETURNS returns 1 while RETURNS SETOF returns 0 .. n.

> Actually BL is usually processed oriented, so PL functions coverages changes
> in data, and for queries you use SELECT

OK, so you SELECT directly from tables?
And in the PLs you change a lot of rows in the same txn?

> Returning SET from function is less often - and usually it is not in
> preferred patterns because you can very simple block a optimizer.

Not if you do all access, also SELECT via PLs, then you might want to returns
lists of things based on some input.

But that's a different topic. What I wanted to examplify is the fact
we *already*
have a lot of syntax which handles the 1 row case in a special way.



pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: PL/pgSQL 1.2
Next
From: Pavel Stehule
Date:
Subject: Re: PL/pgSQL 1.2