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 1glbUk-00082P-KG for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Jan 2019 15:28:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1glbUi-0002hr-Io for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Jan 2019 15:28:12 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1glbUi-0002hk-Bi for pgsql-hackers@lists.postgresql.org; Mon, 21 Jan 2019 15:28:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1glbUf-0003Pw-Rj for pgsql-hackers@postgresql.org; Mon, 21 Jan 2019 15:28:11 +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 x0LFRu3J029577; Mon, 21 Jan 2019 10:27:56 -0500 From: Tom Lane To: Andreas Karlsson cc: Robert Haas , Andres Freund , Thomas Munro , Andrew Gierth , David Fetter , Pg Hackers Subject: Re: Early WIP/PoC for inlining CTEs In-reply-to: <5715d93e-6ebc-be17-c2c3-56a873100a38@proxel.se> 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> Comments: In-reply-to Andreas Karlsson message dated "Mon, 21 Jan 2019 14:40:34 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29575.1548084476.1@sss.pgh.pa.us> Date: Mon, 21 Jan 2019 10:27:56 -0500 Message-ID: <29576.1548084476@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andreas Karlsson writes: > I have a minor biksheddish question about the syntax. > You proposed: > WITH cte_name [[NOT] MATERIALIZED] AS (query) main_query > While Andrew proposed: > WITH cte_name AS [[NOT] MATERIALIZED] (query) main_query > Do people have any preference between these two? FWIW, I'd independently thought that the latter is more readable, and probably less likely to have syntax problems with future extensions (since AS is already fully reserved). Didn't get around to mentioning it yet, but +1 for putting AS first. regards, tom lane