pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #17662: Error on UPDATE with ()
2+ messages / 2 participants
[nested] [flat]
* BUG #17662: Error on UPDATE with ()
@ 2022-10-24 17:04 PG Bug reporting form <noreply@postgresql.org>
0 siblings, 1 reply; 2+ messages in thread
From: PG Bug reporting form @ 2022-10-24 17:04 UTC (permalink / raw)
To: pgsql-bugs@lists.postgresql.org; +Cc: julionti@gmail.com
The following bug has been logged on the website:
Bug reference: 17662
Logged by: Julio Figueiredo
Email address: julionti@gmail.com
PostgreSQL version: 14.4
Operating system: CENTOS8
Description:
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
if I use
update table set
(column1,c2)=(v1,v2)
where 1=2
everithing is ok
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #17662: Error on UPDATE with ()
@ 2022-10-25 14:13 Tom Lane <tgl@sss.pgh.pa.us>
parent: PG Bug reporting form <noreply@postgresql.org>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2022-10-25 14:13 UTC (permalink / raw)
To: julionti@gmail.com; +Cc: pgsql-bugs@lists.postgresql.org
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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2022-10-25 14:13 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-10-24 17:04 BUG #17662: Error on UPDATE with () PG Bug reporting form <noreply@postgresql.org>
2022-10-25 14:13 ` Tom Lane <tgl@sss.pgh.pa.us>
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