Skip site navigation (1) Skip section navigation (2)

Re: TupleDesc refcounting

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: TupleDesc refcounting
Date: 2006-01-15 17:08:16
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Neil Conway <neilc(at)samurai(dot)com> writes:
> On Thu, 2006-01-12 at 10:40 -0500, Tom Lane wrote:
>> If you're finding yourself writing a large and invasive patch, I think
>> you're doing it wrong.

> I think I might be :-)

Yipes ... this seems far more invasive than I think is justified.
In particular the notion of storing *every* tupdesc in TopMemoryContext
seems completely wrong.  That's not working with the context system,
that's working against it.

What I had in mind was an optional refcounting facility, whereas you
seem to be going in the direction of making it mandatory.  The reason
I think it should be optional is that most uses of tupdescs just don't
need it.  We have a grand total of one place where a refcount (or forced
local copy) seems demonstrably necessary.  Surely changing a whole lot
of code to accommodate that one place is not the right tradeoff.

My inclination at this point is to forget the whole thing and just patch
the callers of lookup_rowtype_tupdesc that need to copy the tupdesc.

			regards, tom lane

In response to


pgsql-patches by date

Next:From: Tom LaneDate: 2006-01-15 17:17:35
Subject: Re: inferred param types for PREPARE
Previous:From: Neil ConwayDate: 2006-01-15 08:03:37
Subject: inferred param types for PREPARE

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group