pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Merlin Moncure <mmoncure@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Jan Wieck <JanWieck@Yahoo.com>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: depstein@alliedtesting.com
Cc: pgsql-bugs@postgresql.org
Cc: pgagarinov@alliedtesting.com
Cc: vshahov@alliedtesting.com
Subject: Re: Can't use WITH in a PERFORM query in PL/pgSQL?
Date: Thu, 20 Oct 2011 11:51:52 +0800
Message-ID: <4E9F9AD8.1070003@ringerc.id.au> (raw)
In-Reply-To: <19857.1319059403@sss.pgh.pa.us>
References: <29F36C7C98AB09499B1A209D48EAA615B501DA9401@mail2a.alliedtesting.com>
	<201109061743.p86HhQX16354@momjian.us>
	<CA+TgmoazonH3XsKwCO1-MSpd+YnT48TpzcHjEJRJQDjkY1Y-AA@mail.gmail.com>
	<CAHyXU0zEzSSrf3C4nzP3=LGbWhwjpKzL=xpTztUYrPPc3btKAg@mail.gmail.com>
	<19518.1319057158@sss.pgh.pa.us>
	<19857.1319059403@sss.pgh.pa.us>

On 10/20/2011 05:23 AM, Tom Lane wrote:
> I wrote:
>> Merlin Moncure<mmoncure@gmail.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



view thread (24+ messages)  latest in thread

Message-ID: <4E9F9AD8.1070003@ringerc.id.au>
Permalink:  ../4E9F9AD8.1070003@ringerc.id.au/
Also on:    postgresql.org/message-id/4E9F9AD8.1070003@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: ringerc@ringerc.id.au, tgl@sss.pgh.pa.us, mmoncure@gmail.com, robertmhaas@gmail.com, JanWieck@Yahoo.com, bruce@momjian.us, depstein@alliedtesting.com, pgagarinov@alliedtesting.com, vshahov@alliedtesting.com
  Subject: Re: Can't use WITH in a PERFORM query in PL/pgSQL?
  In-Reply-To: <4E9F9AD8.1070003@ringerc.id.au>
  References: <29F36C7C98AB09499B1A209D48EAA615B501DA9401@mail2a.alliedtesting.com> <201109061743.p86HhQX16354@momjian.us> <CA+TgmoazonH3XsKwCO1-MSpd+YnT48TpzcHjEJRJQDjkY1Y-AA@mail.gmail.com> <CAHyXU0zEzSSrf3C4nzP3=LGbWhwjpKzL=xpTztUYrPPc3btKAg@mail.gmail.com> <19518.1319057158@sss.pgh.pa.us> <19857.1319059403@sss.pgh.pa.us> <4E9F9AD8.1070003@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox