On Sun, 2006-01-08 at 20:04 -0500, Tom Lane wrote:
> On reflection I think that lookup_rowtype_tupdesc is simply misdesigned.
> We can't have it handing back a pointer to a data structure of unspecified
> lifetime. One possibility is to give it an API comparable to the
> syscache lookup functions, ie you get a reference-counted pointer that
> you have to explicitly release when done with it.
This seems a cleaner approach.
> One big strike against the reference-count approach is that it'd be
> difficult to back-patch such a solution into existing branches, since
> it would amount to an incompatible API change.
Perhaps adding a palloc() to lookup_rowtype_tupdesc() can be done for
back branches (which should be minimally invasive), and a
reference-counting API can be implemented for 8.2.
I'd be happy to volunteer to do the refcounting changes, in the
(probably unlikely :) ) event you'd rather not do the work yourself.
-Neil