Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fSgbC-0006ae-Fh for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Jun 2018 10:32:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fSgbB-0007md-DO for pgsql-bugs@arkaria.postgresql.org; Tue, 12 Jun 2018 10:32:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fSgXh-0003ig-Rx for pgsql-bugs@lists.postgresql.org; Tue, 12 Jun 2018 10:28:49 +0000 Received: from lungold.riddles.org.uk ([82.68.208.19]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fSgXe-0007XN-63 for pgsql-bugs@lists.postgresql.org; Tue, 12 Jun 2018 10:28:48 +0000 Received: from [192.168.127.1] (port=45305 helo=caithnard.riddles.org.uk) by lungold.riddles.org.uk with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.88 (FreeBSD)) (envelope-from ) id 1fSgXX-000KBe-TD; Tue, 12 Jun 2018 10:28:39 +0000 Received: from [127.0.0.1] (port=40637 helo=caithnard.riddles.org.uk) by caithnard.riddles.org.uk with esmtp (Exim 4.89 (FreeBSD)) (envelope-from ) id 1fSgXX-000Ldr-6w; Tue, 12 Jun 2018 10:28:39 +0000 From: Andrew Gierth To: Tom Lane Cc: 110876189@qq.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15237: I got "ERROR: source for a multiple-column UPDATE item must be a sub-SELECT or ROW() expression" In-Reply-To: <22079.1528774703@sss.pgh.pa.us> (Tom Lane's message of "Mon, 11 Jun 2018 23:38:23 -0400") Message-ID: <87r2lctidw.fsf@news-spur.riddles.org.uk> References: <152876885706.32361.1270737678956483321@wrigleys.postgresql.org> <22079.1528774703@sss.pgh.pa.us> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (berkeley-unix) Date: Tue, 12 Jun 2018 11:28:38 +0100 MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk >>>>> "Tom" == Tom Lane writes: >> On PostgreSQL 11 Beta, I exec sql like "update >> fvt_obj_operate_update_table_033 set (c_int) = (20) where c_int = 20;", >> which only on column to set, got ""ERROR: source for a multiple-column >> UPDATE item must be a sub-SELECT or ROW() expression"". Tom> It's telling you what to do: use a ROW() expression, ie Tom> update fvt_obj_operate_update_table_033 set (c_int) = row(20) Tom> where c_int = 20; Yeah, but (a) this used to work, and has worked since at least as far back as 9.0, and (b) the spec requires it to work. -- Andrew (irc:RhodiumToad)