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 1mQ9x4-0005aH-HE for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Sep 2021 15:02:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mQ9x2-0006BL-MY for pgsql-bugs@arkaria.postgresql.org; Tue, 14 Sep 2021 15:02:24 +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 1mQ9x2-0006BD-G1 for pgsql-bugs@lists.postgresql.org; Tue, 14 Sep 2021 15:02:24 +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 1mQ9wx-0007EY-Ed for pgsql-bugs@lists.postgresql.org; Tue, 14 Sep 2021 15:02:23 +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 18EF2D1N594112; Tue, 14 Sep 2021 11:02:13 -0400 From: Tom Lane To: Peter Eisentraut cc: David Rowley , sait.nisanci@microsoft.com, PostgreSQL mailing lists Subject: Re: BUG #17158: Distinct ROW fails with Postgres 14 In-reply-to: <2f0f926d-23c9-2ded-4032-dee85be733dc@enterprisedb.com> References: <17158-8a2ba823982537a4@postgresql.org> <496046.1629843371@sss.pgh.pa.us> <2021952.1630442634@sss.pgh.pa.us> <7fb17b3d-13dc-fc28-17ce-9c302d676bd8@enterprisedb.com> <4519d7da-7402-cff3-d577-0bc8511e0c9a@enterprisedb.com> <4092959.1631302070@sss.pgh.pa.us> <2f0f926d-23c9-2ded-4032-dee85be733dc@enterprisedb.com> Comments: In-reply-to Peter Eisentraut message dated "Tue, 14 Sep 2021 16:39:39 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <594110.1631631733.1@sss.pgh.pa.us> Date: Tue, 14 Sep 2021 11:02:13 -0400 Message-ID: <594111.1631631733@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Peter Eisentraut writes: > On 10.09.21 21:27, Tom Lane wrote: >> Perhaps it'd work to put the phony entry into fcinfo->flinfo->fn_mcxt >> instead of CacheMemoryContext. > Ok, the attached patch fixes the valgrind error. Looks roughly sane to me. I'm of two minds about whether you ought to change the palloc to palloc0. We'd have taken much longer to notice this problem if palloc0 had been used; but from any standpoint other than "will valgrind catch it", it seems like zeroing the fake typcache entry would be safer. regards, tom lane