Re: BUG #17662: Error on UPDATE with ()

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: julionti(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17662: Error on UPDATE with ()
Date: 2022-10-25 14:13:32
Message-ID: 4011529.1666707212@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> The bellow command return : ERROR: source for a multiple-column UPDATE item
> must be a sub-SELECT or ROW() expression
> update table set
> (column)=(value)
> where 1=2

The error is telling you what to do. You should write:

update table set
(column) = ROW(value)
where 1=2

The ROW keyword is optional for a multi-column row, since
(v1,v2) couldn't mean anything else. But if there's just
one item, the parentheses are noise; they don't turn it
into a row.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Jeff Janes 2022-10-26 00:58:50 generated columns bug, see inconsistent data
Previous Message PG Bug reporting form 2022-10-24 17:04:24 BUG #17662: Error on UPDATE with ()