Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a6Na5-00020Y-Sf for pgsql-bugs@arkaria.postgresql.org; Tue, 08 Dec 2015 19:05:45 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a6Na4-0003XL-RE for pgsql-bugs@arkaria.postgresql.org; Tue, 08 Dec 2015 19:05:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a6NZT-0002nR-1v for pgsql-bugs@postgresql.org; Tue, 08 Dec 2015 19:05:07 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a6NZL-0004mA-FG for pgsql-bugs@postgresql.org; Tue, 08 Dec 2015 19:05:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id tB8J4sHu017258; Tue, 8 Dec 2015 14:04:54 -0500 From: Tom Lane To: Kevin Grittner cc: "David G. Johnston" , mike.lang1010@gmail.com, "pgsql-bugs@postgresql.org" Subject: Re: BUG #13798: Unexpected multiple exection of user defined function with out parameters In-reply-to: References: <20151205063015.2622.52326@wrigleys.postgresql.org> Comments: In-reply-to Kevin Grittner message dated "Tue, 08 Dec 2015 12:31:33 -0600" Date: Tue, 08 Dec 2015 14:04:54 -0500 Message-ID: <17257.1449601494@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Kevin Grittner writes: > On Tue, Dec 8, 2015 at 10:24 AM, David G. Johnston > wrote: >> While you've explained how to see what is happening it doesn't remove >> the POLA violation that has occurred here. > I tend to think of x.* as being something that is resolved at parse > analysis time, before any consideration is given to how to execute; > thus, when x is a function I didn't find it at all astonishing that > it resolved as above. As far as table references go, it's effectively required by the SQL spec that "tab.*" in a SELECT list is expanded to "tab.c1, tab.c2, etc" at parse time. (I draw this conclusion from the parts of the spec that say that tab.*'s meaning in a view referencing tab does not change if tab subsequently gains new columns.) It's definitely annoying that (foo()).* is expanded similarly; but to fix that we'd have to introduce an additional layer of evaluation into SELECT lists, and I think that might create some visible semantic oddities of its own. Between backwards-compatibility worries and the existence of the LATERAL workaround, it's unlikely we'll ever change this. I'm not sure how well this point is documented, though. Might be worth some effort in that direction. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs