Skip site navigation (1) Skip section navigation (2)

Re: Can't use WITH in a PERFORM query in PL/pgSQL?

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Jan Wieck <JanWieck(at)Yahoo(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, depstein(at)alliedtesting(dot)com, pgsql-bugs(at)postgresql(dot)org, pgagarinov(at)alliedtesting(dot)com, vshahov(at)alliedtesting(dot)com
Subject: Re: Can't use WITH in a PERFORM query in PL/pgSQL?
Date: 2011-10-20 03:51:52
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
On 10/20/2011 05:23 AM, Tom Lane wrote:
> I wrote:
>> Merlin Moncure<mmoncure(at)gmail(dot)com>  writes:
>>> The point being, how do I convert any query to a non WITH variant so
>>> it can be PERFORM'd?  Anyways, I always thought having to do perform
>>> at all was pretty weak sauce -- not sure why it's required.
>> Possibly it was an Oracle compatibility thing ... anyone know PL/SQL
>> well enough to say how this works there?
> After writing that, I remembered I had an old PL/SQL manual sitting
> about, so I took a look.  So far as I can see, there is no PERFORM
> statement in PL/SQL, and no SELECT-without-INTO either; that is, the
> functionality of executing a SELECT and discarding the result simply
> isn't there.
> So at this point it looks like we made up PERFORM out of whole cloth,
> and we could just as easily choose to do it another way.

How does PL/SQL handle multiple result set returns?

PL/PgSQL doesn't currently support that, but if true stored procedures 
land up in someone's sights down the track it'll be important to be able 
to support multiple result sets. If compatibility is of interest, then 
it'd be good to know whether PL/SQL uses "RETURN SELECT" or just 
"SELECT" to produce a result set.

If it just uses "SELECT" (and it sounds like it does from the above) 
then perhaps retaining that meaning, and thus disallowing it from 
functions that cannot return multiple result sets, would be better. When 
true stored procs are implemented they can then permit bare SELECTs, 
emitting their output as a resultset.

Craig Ringer

In response to

pgsql-bugs by date

Next:From: Pavel StehuleDate: 2011-10-20 04:35:56
Subject: Re: Can't use WITH in a PERFORM query in PL/pgSQL?
Previous:From: Tom LaneDate: 2011-10-19 21:23:23
Subject: Re: Can't use WITH in a PERFORM query in PL/pgSQL?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group