Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goDdB-00062B-Io for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Jan 2019 20:35:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1goDdA-0006sE-DY for pgsql-hackers@arkaria.postgresql.org; Mon, 28 Jan 2019 20:35:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goDdA-0006qz-2M for pgsql-hackers@lists.postgresql.org; Mon, 28 Jan 2019 20:35:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1goDd7-0005IO-Op for pgsql-hackers@postgresql.org; Mon, 28 Jan 2019 20:35:43 +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 x0SKZWHW012409; Mon, 28 Jan 2019 15:35:32 -0500 From: Tom Lane To: Robert Haas cc: Andreas Karlsson , Andres Freund , Thomas Munro , Andrew Gierth , David Fetter , Pg Hackers Subject: Re: Early WIP/PoC for inlining CTEs In-reply-to: References: <8810.1542402910@sss.pgh.pa.us> <87r2dxrw1z.fsf@news-spur.riddles.org.uk> <20190111181934.g5qig23o7rxubnjt@alap3.anarazel.de> <20190111190403.77ye7m5mxypxsf4l@alap3.anarazel.de> <00818be9-2f63-f584-efcd-d97ee0662905@proxel.se> <5715d93e-6ebc-be17-c2c3-56a873100a38@proxel.se> <29576.1548084476@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Mon, 28 Jan 2019 14:00:33 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <12407.1548707732.1@sss.pgh.pa.us> Date: Mon, 28 Jan 2019 15:35:32 -0500 Message-ID: <12408.1548707732@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > However, generally we have not had great luck with just sticking > keywords in there (cf. VACUUM, ANALYZE, EXPLAIN, COPY) which is why I > suggested using a flexible syntax with parenthesized options. Fair, except that as you then proceed to point out, that does not work either before or after the AS. Conceivably we could make it work without the parens: WITH ctename AS [ option = value [ , .... ] ] ( query .... ) which for the immediate feature I'd be tempted to spell as WITH ctename AS [ materialize = on/off ] ( query ... ) I think the only reason the syntax is MATERIALIZED with a D is that that's already a keyword; it reads a bit awkwardly IMO. But if we were accepting a ColId there, there'd be room to adjust the spelling. That said, this is still clunkier than the existing proposal, and I'm not really convinced that we need to leave room for more options. regards, tom lane