UPDATE ... SET (single_column) = row_constructor is a bit broken from V10 906bfcad7ba7c - Mailing list pgsql-hackers

From Mahendra Singh Thalor
Subject UPDATE ... SET (single_column) = row_constructor is a bit broken from V10 906bfcad7ba7c
Date
Msg-id CAKYtNAoF0=kY5F00z7ru1vKgiL-SgbKmyewmPHJchsNeKArWCQ@mail.gmail.com
Whole thread Raw
Responses Re: UPDATE ... SET (single_column) = row_constructor is a bit broken from V10 906bfcad7ba7c  (Justin Pryzby <pryzby@telsasoft.com>)
List pgsql-hackers
Hi Hackers,

Commit 906bfcad7ba7c has improved handling for "UPDATE ... SET (column_list) = row_constructor", but it has broken in some cases where it was working prior to this commit.
After this commit query “DO UPDATE SET (t1_col)” is giving an error which was working fine earlier.

commit 906bfcad7ba7cb3863fe0e2a7810be8e3cd84fbd
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date:   Tue Nov 22 15:19:57 2016 -0500

    Improve handling of "UPDATE ... SET (column_list) = row_constructor".
   
    Previously, the right-hand side of a multiple-column assignment, if it
 

Test case:
CREATE TABLE t1 (id1 int NOT NULL primary key, t1_col text NOT NULL);
INSERT INTO t1(id1, t1_col) VALUES (88,'test1') ON CONFLICT ( id1 )
DO UPDATE SET (t1_col) = ('test2');
ERROR:  source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression
LINE 1: ...')    ON CONFLICT ( id1 )DO UPDATE SET (t1_col) = ('test2');
                                                              ^
I am getting above error from v10 to master but it is passing in v96 and v95.

If we change "SET (t1_col)" to "SET t1_col", then the above test case is passing in all the branches.

This looks like a bug.

Thoughts?

Thanks and Regards
Mahendra Singh Thalor
EnterpriseDB: http://www.enterprisedb.com

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [PATCH] Identify LWLocks in tracepoints
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump.