pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: julionti@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17662: Error on UPDATE with ()
Date: Tue, 25 Oct 2022 10:13:32 -0400
Message-ID: <4011529.1666707212@sss.pgh.pa.us> (raw)
In-Reply-To: <17662-a7d95eb9537054b5@postgresql.org>
References: <17662-a7d95eb9537054b5@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





view thread (2+ messages)

Message-ID: <4011529.1666707212@sss.pgh.pa.us>
Permalink:  ../4011529.1666707212@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4011529.1666707212@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, julionti@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17662: Error on UPDATE with ()
  In-Reply-To: <4011529.1666707212@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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