Re: lookup_rowtype_tupdesc considered harmful

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: lookup_rowtype_tupdesc considered harmful
Дата
Msg-id 1136827045.8851.17.camel@localhost.localdomain
обсуждение исходный текст
Ответ на lookup_rowtype_tupdesc considered harmful  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: lookup_rowtype_tupdesc considered harmful  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: plperl vs LC_COLLATE (was Re: Possible savepoint bug)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: lookup_rowtype_tupdesc considered harmful