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 1mceam-0002jp-VC for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Oct 2021 02:11:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mceal-0008TA-P1 for pgsql-bugs@arkaria.postgresql.org; Tue, 19 Oct 2021 02:11:03 +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 1mceal-0008T1-Hi for pgsql-bugs@lists.postgresql.org; Tue, 19 Oct 2021 02:11:03 +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 1mceaj-0002UN-Gf for pgsql-bugs@lists.postgresql.org; Tue, 19 Oct 2021 02:11:02 +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 19J2Akq01732942; Mon, 18 Oct 2021 22:10:46 -0400 From: Tom Lane To: ocean_li_996@163.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17236: Postgres core on pstate->p_multiassign_exprs In-reply-to: <17236-3210de9bcba1d7ca@postgresql.org> References: <17236-3210de9bcba1d7ca@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 18 Oct 2021 11:20:14 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1732940.1634609446.1@sss.pgh.pa.us> Date: Mon, 18 Oct 2021 22:10:46 -0400 Message-ID: <1732941.1634609446@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: > Postgres will crash when executing the following SQL: > CREATE TABLE v0 ( v1 INT , v2 INT ) ; > UPDATE v0 SET ( v1 , v2 ) = ( SELECT v2 + 127 , v1 FROM v0 ) , v2 = ( v2 , > v1 ) , v1 = 53 , v2 = 54 ; Hmm, with assertions off I get ERROR: column "v2" is of type integer but expression is of type record LINE 1: ...( v1 , v2 ) = ( SELECT v2 + 127 , v1 FROM v0 ) , v2 = ( v2 , ^ HINT: You will need to rewrite or cast the expression. and if I remove that I get a complaint about multiple assignments to the same column. Were you expecting this query to do something useful, or was it just fuzzing? (Not that we shouldn't fix the assertion failure. I'm just wondering about the context.) regards, tom lane