Re: Life cycles of tuple descriptors

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Chapman Flack <chap(at)anastigmatix(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Life cycles of tuple descriptors
Date: 2021-12-15 23:18:04
Message-ID: CA+hUKGKHYN2t=gdwWsDVED4TRnuwpzOJvU-dQVYBGFgtevfb0w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Dec 16, 2021 at 11:51 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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. None of these call
> sites are so performance-critical that one extra test will hurt.

LGTM.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Chapman Flack 2021-12-15 23:20:11 Re: Life cycles of tuple descriptors
Previous Message Tom Lane 2021-12-15 22:50:41 Re: Life cycles of tuple descriptors