PG10b2: column-list UPDATE syntax fails with single column

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: PG10b2: column-list UPDATE syntax fails with single column
Date: 2017-07-19 17:45:07
Message-ID: 20170719174507.GA19616@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In testing our application with PG10beta2, I discovered that our use of UPDATE
broke, apparently by this commit

|commit 906bfcad7ba7cb3863fe0e2a7810be8e3cd84fbd
|Author: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
|Date: Tue Nov 22 15:19:57 2016 -0500
|
| Improve handling of "UPDATE ... SET (column_list) = row_constructor".

ERROR ON QUERY: UPDATE eric_enodeb_cell_metrics SET (pmActiveDrbDlSum)=(%s) WHERE sect_id=%s AND subnetwork_id=%s AND start_time=%s AND site_id=%s AND interval_seconds=%s AND nedn=%s AND mecontext=%s AND EUtranCellxDD=%s AND EUtranCell=%s AND subnetwork=%s AND device_id=%s --
Query Error: ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression

This still works for multiple columns but in pg10b2 no longer works for single
column update with "column_list" syntax.

ts=# begin; UPDATE eric_enodeb_201707 SET (pmhdelayvarbest50pct,pmlicconnecteduserstimecong)=(0,0) ;
BEGIN
UPDATE 3
ts=# begin; UPDATE eric_enodeb_201707 SET (pmhdelayvarbest50pct)=(0) ;
BEGIN
ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression

It may be that our use was wrong (?) or unintuitive (I'm in the middle of
changing it), but wondered if it was intentional or otherwise if the release
notes should mention that old syntax is no longer accepted.

Either way - thanks in advance.

Justin

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-07-19 17:53:24 Re: Pluggable storage
Previous Message Ashutosh Sharma 2017-07-19 17:44:58 Re: pl/perl extension fails on Windows