Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hCqHu-0003xs-Vo for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Apr 2019 18:43:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hCqHt-00038q-JP for pgsql-hackers@arkaria.postgresql.org; Sat, 06 Apr 2019 18:43:33 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hCqHt-00038j-BG for pgsql-hackers@lists.postgresql.org; Sat, 06 Apr 2019 18:43:33 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hCqHr-0001gu-7X for pgsql-hackers@lists.postgresql.org; Sat, 06 Apr 2019 18:43:32 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x36IhQcg007310; Sat, 6 Apr 2019 14:43:26 -0400 From: Tom Lane To: Andres Freund cc: pgsql-hackers@lists.postgresql.org, Hadi Moshayedi Subject: Re: tableam scan-API patch broke foreign key validation In-reply-to: <20190406183834.3dvhl24sxicgblaj@alap3.anarazel.de> References: <19030.1554574075@sss.pgh.pa.us> <19246.1554574409@sss.pgh.pa.us> <20190406182258.pvk5zkqdc6dobfg7@alap3.anarazel.de> <19906.1554575674@sss.pgh.pa.us> <20190406183834.3dvhl24sxicgblaj@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Sat, 06 Apr 2019 11:38:34 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <7308.1554576206.1@sss.pgh.pa.us> Date: Sat, 06 Apr 2019 14:43:26 -0400 Message-ID: <7309.1554576206@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On 2019-04-06 14:34:34 -0400, Tom Lane wrote: >> Why should this code need to free anything? That'd be the responsibility >> of the slot code, no? > Well, not really. If a slot doesn't hold heap tuples internally, > ExecFetchSlotHeapTuple() will return a fresh heap tuple (but signal so > by setting *should_free = true if not NULL). Ah, got it: ignoring should_free is indeed a potential issue here. >> But clearly we need a test case here. I'll adjust Hadi's example >> so that there's more than one tuple to check, and push it. > Cool. Sounds like a plan. regards, tom lane