Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 7F45AB5DC29 for ; Wed, 19 Oct 2011 18:23:40 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 53941-02 for ; Wed, 19 Oct 2011 21:23:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 64A80B5DC27 for ; Wed, 19 Oct 2011 18:23:34 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id p9JLNNEp019858; Wed, 19 Oct 2011 17:23:23 -0400 (EDT) To: Merlin Moncure cc: Robert Haas , Jan Wieck , Bruce Momjian , depstein@alliedtesting.com, pgsql-bugs@postgresql.org, pgagarinov@alliedtesting.com, vshahov@alliedtesting.com Subject: Re: Can't use WITH in a PERFORM query in PL/pgSQL? In-reply-to: <19518.1319057158@sss.pgh.pa.us> References: <29F36C7C98AB09499B1A209D48EAA615B501DA9401@mail2a.alliedtesting.com> <201109061743.p86HhQX16354@momjian.us> <19518.1319057158@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 19 Oct 2011 16:45:58 -0400" Date: Wed, 19 Oct 2011 17:23:23 -0400 Message-ID: <19857.1319059403@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-2.404 tagged_above=-5 required=5 tests=BAYES_00=-1.9, RP_MATCHES_RCVD=-0.504 X-Spam-Level: X-Archive-Number: 201110/188 X-Sequence-Number: 31458 I wrote: > Merlin Moncure 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. Jan, do you remember anything about the reasoning for PERFORM? regards, tom lane