Doc: call out UPDATE syntax change as a v10 compatibility issue.

The change made by commit 906bfcad7 means that if you're writing
a parenthesized column list in UPDATE ... SET, but that column list
is only one column, you now need to write ROW(expression) on the
righthand side, not just a parenthesized expression.  This was an
intentional change for spec compatibility and potential future
expansion of the possibilities for the RHS, but I'd neglected to
document it as a compatibility issue, figuring that hardly anyone
would bother with parenthesized syntax for a single target column.
I was wrong, as shown by questions from Justin Pryzby, Adam Brusselback,
and others.  Move the release note item into the compatibility section
and point out the behavior change for a single target column.

Discussion: https://postgr.es/m/CAMjNa7cDLzPcs0xnRpkvqmJ6Vb6G3EH8CYGp9ZBjXdpFfTz6dg@mail.gmail.com
This commit is contained in:
Tom Lane 2017-10-30 16:44:26 -04:00
parent be72b9c378
commit 86182b1895
1 changed files with 26 additions and 20 deletions

View File

@ -157,6 +157,32 @@
<listitem>
<!--
2016-11-22 [906bfcad7] Improve handling of "UPDATE ... SET (column_list) = row_
-->
<para>
Use standard row constructor syntax in <literal>UPDATE ... SET
(<replaceable>column_list</replaceable>) = <replaceable>row_constructor</replaceable></literal>
(Tom Lane)
</para>
<para>
The <replaceable>row_constructor</replaceable> can now begin with the
keyword <literal>ROW</literal>; previously that had to be omitted.
If just one column name appears in
the <replaceable>column_list</replaceable>, then
the <replaceable>row_constructor</replaceable> now must use
the <literal>ROW</literal> keyword, since otherwise it is not a valid
row constructor but just a parenthesized expression.
Also, an occurrence
of <literal><replaceable>table_name</replaceable>.*</literal> within
the <replaceable>row_constructor</replaceable> is now expanded into
multiple columns, as occurs in other uses
of <replaceable>row_constructor</replaceable>s.
</para>
</listitem>
<listitem>
<!--
2017-08-04 [c30f1770a] Apply ALTER ... SET NOT NULL recursively in ALTER ... AD
-->
<para>
@ -1538,26 +1564,6 @@
<listitem>
<!--
2016-11-22 [906bfcad7] Improve handling of "UPDATE ... SET (column_list) = row_
-->
<para>
Allow standard row constructor syntax in <literal>UPDATE ... SET
(<replaceable>column_list</replaceable>) = <replaceable>row_constructor</replaceable></literal>
(Tom Lane)
</para>
<para>
The <replaceable>row_constructor</replaceable> can now begin with the
keyword <literal>ROW</literal>; previously that had to be omitted. Also,
an occurrence of <literal><replaceable>table_name</replaceable>.*</literal>
within the <replaceable>row_constructor</replaceable> is now expanded into
multiple columns, as in other uses
of <replaceable>row_constructor</replaceable>s.
</para>
</listitem>
<listitem>
<!--
2016-09-05 [c54159d44] Make locale-dependent regex character classes work for l
-->
<para>