Re: TupleDesc refcounting - Mailing list pgsql-patches

From Tom Lane
Subject Re: TupleDesc refcounting
Date
Msg-id 8743.1137344896@sss.pgh.pa.us
Whole thread Raw
In response to Re: TupleDesc refcounting  (Neil Conway <neilc@samurai.com>)
Responses Re: TupleDesc refcounting
List pgsql-patches
Neil Conway <neilc@samurai.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

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: inferred param types for PREPARE
Next
From: Tom Lane
Date:
Subject: Re: inferred param types for PREPARE