Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uudnu-00EIrB-NV for pgsql-docs@arkaria.postgresql.org; Fri, 05 Sep 2025 21:17:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uudnt-00AX9n-Mf for pgsql-docs@arkaria.postgresql.org; Fri, 05 Sep 2025 21:17:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uudnt-00AX9e-En for pgsql-docs@lists.postgresql.org; Fri, 05 Sep 2025 21:17:05 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uudns-000jtZ-0U for pgsql-docs@lists.postgresql.org; Fri, 05 Sep 2025 21:17:04 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 585LH2aT1529416; Fri, 5 Sep 2025 17:17:03 -0400 From: Tom Lane To: jason@starnull.net cc: pgsql-docs@lists.postgresql.org Subject: Re: SELECT List with/without parentheses In-reply-to: <175702516430.356921.959597202664413151@wrigleys.postgresql.org> References: <175702516430.356921.959597202664413151@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Thu, 04 Sep 2025 22:32:44 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1529414.1757107022.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Fri, 05 Sep 2025 17:17:02 -0400 Message-ID: <1529415.1757107022@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Doc comments form writes: > There is no mention of the difference in PostgreSql behavior if the sele= ct > list of columns is surrounded by parentheses or not. What you've written there is an implicit row constructor, that is "(a,b,...)" is taken as "ROW(a,b,...)". These are documented at [1], but it would be quite unwieldy to point out the possibility of this for every context in which it could be written. Personally I think implicit row constructors were one of the SQL committee's worst ideas, precisely because of the surprise factor. But it's in the standard so we're stuck with it. regards, tom lane [1] https://www.postgresql.org/docs/current/sql-expressions.html#SQL-SYNTA= X-ROW-CONSTRUCTORS