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 1uvNss-00Cqa2-Cz for pgsql-docs@arkaria.postgresql.org; Sun, 07 Sep 2025 22:29:19 +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 1uvNsp-000pBj-OS for pgsql-docs@arkaria.postgresql.org; Sun, 07 Sep 2025 22:29:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uugOm-00BClR-H0 for pgsql-docs@lists.postgresql.org; Sat, 06 Sep 2025 00:03:21 +0000 Received: from fhigh-b5-smtp.messagingengine.com ([202.12.124.156]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uugOi-000nMu-1q for pgsql-docs@lists.postgresql.org; Sat, 06 Sep 2025 00:03:20 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 74AA67A03A0 for ; Fri, 5 Sep 2025 20:03:14 -0400 (EDT) Received: from phl-imap-16 ([10.202.2.88]) by phl-compute-06.internal (MEProxy); Fri, 05 Sep 2025 20:03:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=starnull.net; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1757116994; x=1757203394; bh=Bhs0oE2yK4CQRgxj1kyL3Mm/Y5exoF4AAYMUcBn5Uic=; b= G9X8BskS6i0+MIH0U0itqc2yjBshEuuHuHCskSMFNTePpUl4S7VHeTp2AM3wHhsw kYCRc8a28IcNDZB7a4739DVmkCLt/2kR25fu8LCFRpF4pU6de6Pna7Ne2exZy5KZ grPgw6pMMRXMiSZkqeVfgo1K2kAzrlbIEYLmilU9J8X5jiduizSPVBSHaNDWDwfv SItwJVpMd0euk2W3tdnODulGVDMXZhV0LyLHWHmd1yAPyEmgozKu9n70bN2MV1r/ 0x62gcKFWx6E7+xV5A2pItH+ApAMYwNKv2g2Ya7dt2lNCsR6A9KVgGoYz8Y7q0HT xts2XkIALv0iTP8AokSm2Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1757116994; x=1757203394; bh=B hs0oE2yK4CQRgxj1kyL3Mm/Y5exoF4AAYMUcBn5Uic=; b=VMqoiBKaDOOTtG2Kl 8Uz/dr3TGbPHNpLnPgVJ0gpyFl116ruJmWTymv/eTXF6dt7VAIYl9WpyM0ehNiXi xrISVsKdcoKp53mkicuEqisYTH++rOWCcW91WuZjyZC8h/fJhAQKu345NlcixM3Z g8fQVKL7euO4qbdwMVHhG+cZiWsSdvydf2Sxm/bS9Ne14Kwl7vJ0u8PYttJV/liF ocUrygoN1jyhJtoqDlaWN+kh7ceTDugXSW1A517SuwB8X1dMF3a+IZ65Sv8WE5Io QdwoB/0l6BPapxcOX0pLhrGekvHLx0FAch5iWExvemrecX/uYw16garjMeROF6uC pm4lg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggddutddvjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhepofggfffhvffkjghfufgtgfesthejredtre dttdenucfhrhhomhepfdflrghsohhnucfvihhllhgvrhdfuceojhgrshhonhesshhtrghr nhhulhhlrdhnvghtqeenucggtffrrghtthgvrhhnpedvgeduieegtedvjeelgeffueefte dvieeitdekhffftdehiedtkeeiieetveevudenucffohhmrghinhepphhoshhtghhrvghs qhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepjhgrshhonhesshhtrghrnhhulhhlrdhnvghtpdhnsggprhgtphhtthhopedupdhm ohguvgepshhmthhpohhuthdprhgtphhtthhopehpghhsqhhlqdguohgtsheslhhishhtsh drphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: id9394477:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id A25B62CC0083; Fri, 5 Sep 2025 20:03:13 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface MIME-Version: 1.0 X-ThreadId: Az5iZfr1HR-o Date: Fri, 05 Sep 2025 17:02:53 -0700 From: "Jason Tiller" To: pgsql-docs@lists.postgresql.org Message-Id: <6cc77ca1-54e7-4e8d-a69e-6159fa497cb7@app.fastmail.com> In-Reply-To: <1529415.1757107022@sss.pgh.pa.us> References: <175702516430.356921.959597202664413151@wrigleys.postgresql.org> <1529415.1757107022@sss.pgh.pa.us> Subject: Re: SELECT List with/without parentheses Content-Type: text/plain Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, Tom, Thanks for your feedback! I'm a SQL newbie and the "implicit row constructor" syntax was an unwelcome surprise. I guess painful debugging is one way to cement a concept... Seems like this is a nothing-burger and probably has no place in the PostgreSql documentation. Although I feel like the "principle of least surprise" has been violated here. :/ I appreciate the info! ---Jason On Fri, Sep 5, 2025, at 2:17 PM, Tom Lane wrote: > PG Doc comments form writes: >> There is no mention of the difference in PostgreSql behavior if the select >> 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-SYNTAX-ROW-CONSTRUCTORS On Fri, Sep 5, 2025, at 2:17 PM, Tom Lane wrote: > PG Doc comments form writes: >> There is no mention of the difference in PostgreSql behavior if the select >> 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-SYNTAX-ROW-CONSTRUCTORS