Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 54F0DB5DBD6 for ; Thu, 20 Oct 2011 17:01:53 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 19452-07 for ; Thu, 20 Oct 2011 20:01:47 +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 BAF0FB5DBCE for ; Thu, 20 Oct 2011 17:01:46 -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 p9KK1jbk014231; Thu, 20 Oct 2011 16:01:45 -0400 (EDT) To: Pavel Stehule cc: Valentine Gogichashvili , pgsql-bugs@postgresql.org, Merlin Moncure Subject: Re: Can't use WITH in a PERFORM query in PL/pgSQL? In-reply-to: References: <29F36C7C98AB09499B1A209D48EAA615B501DA9401@mail2a.alliedtesting.com> <201109061743.p86HhQX16354@momjian.us> <19518.1319057158@sss.pgh.pa.us> <25223.1319130933@sss.pgh.pa.us> Comments: In-reply-to Pavel Stehule message dated "Thu, 20 Oct 2011 19:33:37 +0200" Date: Thu, 20 Oct 2011 16:01:45 -0400 Message-ID: <14230.1319140905@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/205 X-Sequence-Number: 31475 Pavel Stehule writes: > I didn't design a PERFORM statement. There is two views - somebody > from sybase's family know so SELECT without into is forwarded to > client. This functionality is missing on Oracle's family. Is true so > PERFORM statement is strange, but maybe it's open door for sybase's > functionality that was not implemented ever. I cannot imagine that we'd ever make SELECT inside a plpgsql function act like that. Functions have no business directly transmitting information to the client; if they tried, they'd most likely just break the FE/BE protocol. There might be use for such a thing in a hypothetical "real stored procedure language" where the code is executing in a context entirely different from what Postgres functions run in ... but that language would be something different from plpgsql. I grant the argument that people coming from Sybase-ish DBs might be confused by this; but the current arrangement is also confusing lots of people, so I don't think that argument has all that much weight. regards, tom lane