Re: lookup_rowtype_tupdesc considered harmful - Mailing list pgsql-hackers

From Neil Conway
Subject Re: lookup_rowtype_tupdesc considered harmful
Date
Msg-id 1136827045.8851.17.camel@localhost.localdomain
Whole thread Raw
In response to lookup_rowtype_tupdesc considered harmful  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: lookup_rowtype_tupdesc considered harmful
List pgsql-hackers
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




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: plperl vs LC_COLLATE (was Re: Possible savepoint bug)
Next
From: Tom Lane
Date:
Subject: Re: lookup_rowtype_tupdesc considered harmful