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 1mQS7k-00079v-VO for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Sep 2021 10:26:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mQS7j-0007MI-VG for pgsql-bugs@arkaria.postgresql.org; Wed, 15 Sep 2021 10:26:39 +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 1mQS7j-0007M8-3O for pgsql-bugs@lists.postgresql.org; Wed, 15 Sep 2021 10:26:39 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mQS7f-000851-N9 for pgsql-bugs@lists.postgresql.org; Wed, 15 Sep 2021 10:26:38 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id D647E5C0138; Wed, 15 Sep 2021 06:26:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 15 Sep 2021 06:26:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=TeJ++3Yfn0QUbpINf0q8cRUM7UuqAlQpbjgiw2V98 EY=; b=pySe28x74XIzsbH1WiWbvqJ3iBKiXHAqecQ1rdx+2GH5fSFDmTAPtPn+0 G+4sJ7A0Cm4n9aaOFuQOg8HGCPHloaXZEVX3lXgCKxxwpiyg2f/yTLYzHl7NoXCV 8AS5tZWwkxNfpLXZBU/KN4gicdD7HRSwmj5Oli48A807bWgjtbDiT/20d8UY1CR7 bd2/Kbf4k2OPcEMzNwnHEG50KfYdbC60J5rGjVZ8v3IoR45IQDlZRUO82K8gYwnL ViI7fLJAWmmiKse1cpoBjZoGFfH67bZx6ycQP6ns6tDY+0uellU83EWc8LRoEOhu 6MQiHQ/465UyrraypPtTlgyRe4tHw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudehuddgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhffkffgfgggjtgfgsehtje ertddtfeejnecuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghr rdgvihhsvghnthhrrghuthesvghnthgvrhhprhhishgvuggsrdgtohhmqeenucggtffrrg htthgvrhhnpeelveehheeuieduieetiedtkeeuteelfeetjeffieffudegvdffvdfftdei vdeukeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hpvghtvghrrdgvihhsvghnthhrrghuthesvghnthgvrhhprhhishgvuggsrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 15 Sep 2021 06:26:32 -0400 (EDT) Subject: Re: BUG #17158: Distinct ROW fails with Postgres 14 To: Tom Lane Cc: David Rowley , sait.nisanci@microsoft.com, PostgreSQL mailing lists 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> <594111.1631631733@sss.pgh.pa.us> From: Peter Eisentraut Message-ID: Date: Wed, 15 Sep 2021 12:26:29 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <594111.1631631733@sss.pgh.pa.us> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 14.09.21 17:02, Tom Lane wrote: > 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. Yeah, pushed with the palloc0.