Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1onKgT-0003By-Tu for pgsql-bugs@arkaria.postgresql.org; Tue, 25 Oct 2022 14:13:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1onKgS-0003aN-LS for pgsql-bugs@arkaria.postgresql.org; Tue, 25 Oct 2022 14:13:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1onKgS-0003aE-DN for pgsql-bugs@lists.postgresql.org; Tue, 25 Oct 2022 14:13:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1onKgQ-0005aI-0c for pgsql-bugs@lists.postgresql.org; Tue, 25 Oct 2022 14:13:35 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 29PEDW3b4011530; Tue, 25 Oct 2022 10:13:32 -0400 From: Tom Lane To: julionti@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17662: Error on UPDATE with () In-reply-to: <17662-a7d95eb9537054b5@postgresql.org> References: <17662-a7d95eb9537054b5@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 24 Oct 2022 17:04:24 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4011528.1666707212.1@sss.pgh.pa.us> Date: Tue, 25 Oct 2022 10:13:32 -0400 Message-ID: <4011529.1666707212@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form 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