Re: SELECT List with/without parentheses - Mailing list pgsql-docs

From Tom Lane
Subject Re: SELECT List with/without parentheses
Date
Msg-id 1529415.1757107022@sss.pgh.pa.us
Whole thread Raw
In response to SELECT List with/without parentheses  (PG Doc comments form <noreply@postgresql.org>)
Responses Re: SELECT List with/without parentheses
List pgsql-docs
PG Doc comments form <noreply@postgresql.org> 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



pgsql-docs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: SELECT List with/without parentheses
Next
From: "Jason Tiller"
Date:
Subject: Re: SELECT List with/without parentheses