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 1nW2Bb-0004Wi-J1 for pgsql-committers@arkaria.postgresql.org; Sun, 20 Mar 2022 20:29:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nW2Ba-0000ex-Do for pgsql-committers@arkaria.postgresql.org; Sun, 20 Mar 2022 20:29:58 +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 1nW2Ba-0000ei-77 for pgsql-committers@lists.postgresql.org; Sun, 20 Mar 2022 20:29:58 +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 1nW2BY-0003XF-2c for pgsql-committers@lists.postgresql.org; Sun, 20 Mar 2022 20:29:57 +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 22KKTq2M1596412; Sun, 20 Mar 2022 16:29:52 -0400 From: Tom Lane To: Alvaro Herrera cc: pgsql-committers@lists.postgresql.org Subject: Re: pgsql: Enforce foreign key correctly during cross-partition updates In-reply-to: References: Comments: In-reply-to Alvaro Herrera message dated "Sun, 20 Mar 2022 17:48:33 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1596410.1647808192.1@sss.pgh.pa.us> Date: Sun, 20 Mar 2022 16:29:52 -0400 Message-ID: <1596411.1647808192@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > Enforce foreign key correctly during cross-partition updates skink is not too happy with this: ==2663594== VALGRINDERROR-BEGIN ==2663594== Conditional jump or move depends on uninitialised value(s) ==2663594== at 0x421526: ExecUpdateAct (nodeModifyTable.c:1855) ==2663594== by 0x4217A3: ExecUpdate (nodeModifyTable.c:2107) ==2663594== by 0x423027: ExecModifyTable (nodeModifyTable.c:2905) ==2663594== by 0x3F5CB8: ExecProcNodeFirst (execProcnode.c:463) ==2663594== by 0x3EE739: ExecProcNode (executor.h:259) ==2663594== by 0x3EE739: ExecutePlan (execMain.c:1633) ==2663594== by 0x3EE90E: standard_ExecutorRun (execMain.c:362) ==2663594== by 0x3EE9D4: ExecutorRun (execMain.c:306) ==2663594== by 0x5B3628: ProcessQuery (pquery.c:160) ==2663594== by 0x5B41E9: PortalRunMulti (pquery.c:1274) ==2663594== by 0x5B47AD: PortalRun (pquery.c:788) ==2663594== by 0x5B091D: exec_simple_query (postgres.c:1250) ==2663594== by 0x5B281B: PostgresMain (postgres.c:4520) ==2663594== Uninitialised value was created by a stack allocation ==2663594== at 0x421433: ExecUpdateAct (nodeModifyTable.c:1773) ==2663594== ==2663594== VALGRINDERROR-END It reproduces easily for me under valgrind. I guess ExecCrossPartitionUpdate must be failing to set inserted_tuple or insert_destrel. regards, tom lane