pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chapman Flack <chap@anastigmatix.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Thomas Munro <thomas.munro@gmail.com>
Subject: Re: Life cycles of tuple descriptors
Date: Wed, 15 Dec 2021 18:20:11 -0500
Message-ID: <61BA782B.3070304@anastigmatix.net> (raw)
In-Reply-To: <753943.1639608641@sss.pgh.pa.us>
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>

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





view thread (10+ messages)  latest in thread

Message-ID: <61BA782B.3070304@anastigmatix.net>
Permalink:  ../61BA782B.3070304@anastigmatix.net/
Also on:    postgresql.org/message-id/61BA782B.3070304@anastigmatix.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: chap@anastigmatix.net, tgl@sss.pgh.pa.us, thomas.munro@gmail.com
  Subject: Re: Life cycles of tuple descriptors
  In-Reply-To: <61BA782B.3070304@anastigmatix.net>
  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> <61BA782B.3070304@anastigmatix.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox