Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bjVMN-0001TK-3A for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Sep 2016 17:49:35 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bjVMM-0007Og-Lw for pgsql-hackers@arkaria.postgresql.org; Mon, 12 Sep 2016 17:49:34 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bjVKz-0005rj-Qz for pgsql-hackers@postgresql.org; Mon, 12 Sep 2016 17:48:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bjVKx-0005ln-Ar for pgsql-hackers@postgresql.org; Mon, 12 Sep 2016 17:48:08 +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 u8CHm5CN009210; Mon, 12 Sep 2016 13:48:05 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@postgresql.org Subject: Re: Implement targetlist SRFs using ROWS FROM() (was Changed SRF in targetlist handling) In-reply-to: <20160912174443.w5w55mkmcyfp67w2@alap3.anarazel.de> References: <20160523005327.v2tr7obytitxcnna@alap3.anarazel.de> <20160822214023.aaxz5l4igypowyri@alap3.anarazel.de> <20160827214829.zo2dfb5jaikii5nw@alap3.anarazel.de> <5460.1473696601@sss.pgh.pa.us> <20160912165403.vshr7tazhr6wrpp4@alap3.anarazel.de> <8136.1473701180@sss.pgh.pa.us> <20160912174443.w5w55mkmcyfp67w2@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Mon, 12 Sep 2016 10:44:43 -0700" Date: Mon, 12 Sep 2016 13:48:05 -0400 Message-ID: <9209.1473702485@sss.pgh.pa.us> X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Andres Freund writes: > On 2016-09-12 13:26:20 -0400, Tom Lane wrote: >> Andres Freund writes: > On 2016-09-12 12:10:01 -0400, Tom Lane wrote: >>>> I can't say that I like the proposed syntax much. >>> Me neither. But I haven't really found a better approach. It seems >>> kinda consistent to have ROWS FROM (... AS ()) change the picked out >>> columns to 0, and just return the whole thing. >> I just remembered that we allow zero-column composite types, which >> makes this proposal formally ambiguous. So we really need a different >> syntax. I'm not especially in love with the cast-to-record idea, but >> it does dodge that problem. > I kind of like ROWS FROM (... AS VALUE), that seems to confer the > meaning quite well. As VALUE isn't a reserved keyword, that'd afaik only > really work inside ROWS FROM() where AS is required. Hm, wouldn't ... AS RECORD convey the meaning better? (Although once you look at it that way, it's just a cast spelled in an idiosyncratic fashion.) regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers