Re: lookup_rowtype_tupdesc considered harmful - Mailing list pgsql-hackers

From Neil Conway
Subject Re: lookup_rowtype_tupdesc considered harmful
Date
Msg-id 1136835720.9116.5.camel@localhost.localdomain
Whole thread Raw
In response to Re: lookup_rowtype_tupdesc considered harmful  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: lookup_rowtype_tupdesc considered harmful
List pgsql-hackers
On Mon, 2006-01-09 at 12:57 -0500, Tom Lane wrote:
> I have not been able to think of an efficient way to make it work while
> still handing back a simple TupleDesc pointer --- seems like we'd have
> to contort the API somehow so that the "release" function can find the
> reference count.  Any thoughts about that?

Perhaps the "release" function can just take a type OID. We could then
use that to lookup the OID's typcache entry, which would be a convenient
place to store the reference count (especially if we do generalized
typcache invalidation, per discussion on -patches). That means two hash
table lookups for each lookup/release pair, which isn't ideal but
doesn't seem too bad.

> I've got plenty of stuff to do, will be happy to let you take up this
> problem, if you have time to do something with it soon.

I'll take a look.

-Neil




pgsql-hackers by date:

Previous
From: Jeremy Drake
Date:
Subject: Re: catalog corruption bug
Next
From: Tom Lane
Date:
Subject: Re: lookup_rowtype_tupdesc considered harmful