From: Tom Lane <tgl@sss.pgh.pa.us>
To: YasonTR <yasontr@protonmail.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: Possible regression in 'UPDATE ... SET (<column list>) = <row expression>' with just one single column/row value since v10
Date: Tue, 24 Oct 2017 10:18:40 -0400
Message-ID: <22434.1508854720@sss.pgh.pa.us> (raw)
In-Reply-To: <DzifLcHs-9wlp5kq6MPKTxu6zI8s5LhAEaVsrq_NRTuQTkw_EWrogrLgDhQ7i5W-cvaIPig0gH59FzBk7Lwr8FUvV7H0fLOYI8heueaoG1Y=@protonmail.com>
References: <DzifLcHs-9wlp5kq6MPKTxu6zI8s5LhAEaVsrq_NRTuQTkw_EWrogrLgDhQ7i5W-cvaIPig0gH59FzBk7Lwr8FUvV7H0fLOYI8heueaoG1Y=@protonmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
YasonTR <yasontr@protonmail.com> writes:
> The following (odd) construction worked in pgv9.x: "UPDATE my_table SET (my_col) = (some value)". This no longer works in v10. It gives the error "source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression". It looks like it only breaks when the column list just holds one single column.
Yeah, IIRC this was an intentional change. The fact that the previous
coding allowed you to do that was a mistake, because per spec you really
need to supply a row value when you parenthesize the SET column list.
As of v10 it should work to write
UPDATE my_table SET (my_col) = ROW(some value)
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, yasontr@protonmail.com
Subject: Re: Possible regression in 'UPDATE ... SET (<column list>) = <row expression>' with just one single column/row value since v10
In-Reply-To: <22434.1508854720@sss.pgh.pa.us>
References: <DzifLcHs-9wlp5kq6MPKTxu6zI8s5LhAEaVsrq_NRTuQTkw_EWrogrLgDhQ7i5W-cvaIPig0gH59FzBk7Lwr8FUvV7H0fLOYI8heueaoG1Y=@protonmail.com> <22434.1508854720@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox