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 1mxdZO-0007aL-UN for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Dec 2021 23:20:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxdZN-0002t0-Mj for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Dec 2021 23:20:21 +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 1mxdZN-0002sr-2J for pgsql-hackers@lists.postgresql.org; Wed, 15 Dec 2021 23:20:21 +0000 Received: from anastigmatix.net ([68.171.219.55]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxdZG-00069W-LE for pgsql-hackers@postgresql.org; Wed, 15 Dec 2021 23:20:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=anastigmatix.net; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vwUkWJhxJ3uBol18JHnSe5rn+Ku98dO9zO35SCbYguw=; b=tFMPuisBWzqvQGAHkEYCJgmnSg tb1b6QKjeOes2CagvPo6Jq5O8SMsZqIsUVPX4rn0pqPAj+6qZcMnV5hwWLAu6NrMmlbGMudyyxAR3 ZjXust4rwuD4BOjvKJFilZx9gkePZ1+mv6qrsnCg38snca+RqWQCNjP6W7csjR0COkNapO6OKM+F9 m+xoUEq305jYKM/fbigqWvvFI9z+TCoOnr7pL0tIKvuRrtC5wX7UaKqmoyf62MCXHkIa5Ejm9lvRj GfFdRsaECLikYWEJseWxcmKK6yjDrMumgLNzMnz1dqB/LZjPsZmH1axrDoz6l7r9huopTiT3Iioen xpoIVXKA==; Received: from [184.19.31.139] (port=55686) by bay.acenet.us with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mxdZE-00HWge-U0; Wed, 15 Dec 2021 18:20:13 -0500 Subject: Re: Life cycles of tuple descriptors To: Tom Lane References: <61B901A4.1050808@anastigmatix.net> <560418.1639522980@sss.pgh.pa.us> <61B92A54.30003@anastigmatix.net> <602839.1639530148@sss.pgh.pa.us> <61B94BC8.6090709@anastigmatix.net> <609406.1639534478@sss.pgh.pa.us> <753943.1639608641@sss.pgh.pa.us> Cc: PostgreSQL Hackers , Thomas Munro From: Chapman Flack Message-ID: <61BA782B.3070304@anastigmatix.net> Date: Wed, 15 Dec 2021 18:20:11 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.0 MIME-Version: 1.0 In-Reply-To: <753943.1639608641@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bay.acenet.us X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - anastigmatix.net X-Get-Message-Sender-Via: bay.acenet.us: authenticated_id: chap@anastigmatix.net X-Authenticated-Sender: bay.acenet.us: chap@anastigmatix.net X-Source: X-Source-Args: X-Source-Dir: X-From-Rewrite: unmodified, already matched List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 12/15/21 17:50, Tom Lane wrote: > Here's a draft patch for this. There are several places that are > directly using DecrTupleDescRefCount after lookup_rowtype_tupdesc > or equivalent, which'd now be forbidden. I think they are all safe > given the assumption that the typcache's tupdescs for named composites > are refcounted. (The calls in expandedrecord.c could be working > with RECORD, but those code paths just checked that the tupdesc > is refcounted.) So there's no actual bug here, and no reason to > back-patch, but this seems like a good idea to decouple callers > a bit more from typcache's internal logic. I agree with the analysis at each of those sites, and the new comment clears up everything that had puzzled me before. Regards, -Chap