Re: BUG #17662: Error on UPDATE with () - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17662: Error on UPDATE with ()
Date
Msg-id 4011529.1666707212@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17662: Error on UPDATE with ()  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.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



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17662: Error on UPDATE with ()
Next
From: Jeff Janes
Date:
Subject: generated columns bug, see inconsistent data