Grund dafür ist aber, dass seit 9.6 auch Updates dieser Art zulässig sind:
update foo
set (a,b) = (select c,d from ..)
where ...
Und in dem Moment wo die Spalte(n) in Klammer stehen, muss auf der rechten Seite ein Sub-Select stehen.
Das zeigt mal wieder, dass die Unsitte zu viele Klammer zu setzen sehr häufig mehr als nur eine schlechte Idee ist.
In Postgres mehr als in anderen Datenbanken. In Postgres ist nämlich “select a,b” etwas anderes als z.B. “select (a,b)”
Ich verstehe nicht warum man da überhaupt einen “Unterschied” machen muss. Ein einzelne Spalte oder einen (skalaren) Wert in Klammer zu setzen ist immer unnötig, egal in welchem Kontext. Und auf der linken Seite einer Zuweisung sowieso.
Use standard row constructor syntax in UPDATE … SET (column_list) = row_constructor (Tom Lane)
The row_constructor can now begin with the keyword ROW; previously that had to be omitted. If just one column name appears in the column_list, then the row_constructor now must use the ROW keyword, since otherwise it is not a valid row constructor but just a parenthesized expression. Also, an occurrence of table_name.* within the row_constructor is now expanded into multiple columns, as occurs in other uses of row_constructors.