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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(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-19 20:45:58
Message-ID: 19518.1319057158@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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?

I suppose you could argue that selecting a value and implicitly throwing
it away is confusing to novices, but on the other hand I've seen a whole
lot of novices confused by the need to write PERFORM instead of SELECT.
I think it wouldn't be an unreasonable thing to just interpret a SELECT
with no INTO clause as being a PERFORM (ie execute and discard results).
Then we'd not have to do anything magic for commands starting with WITH.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2011-10-19 21:21:54 Re: Can't use WITH in a PERFORM query in PL/pgSQL?
Previous Message Tom Lane 2011-10-19 20:41:05 Re: incompatible pointer type