Re: external function proposal for 7.2

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: external function proposal for 7.2
Дата
Msg-id 8234.976684820@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: external function proposal for 7.2  (mlw <markw@mohawksoft.com>)
Список pgsql-hackers
mlw <markw@mohawksoft.com> writes:
> I just have to find where I call the exit function.

That will be the hard part.

FmgrInfo is not currently considered a durable data structure, and I
think you will be in for grief if you try to make any guarantees about
what will happen when one disappears.  If you need a cleanup proc to
be called, I'd suggest looking into registering it to be called at
query completion and/or transaction cleanup/abort, as needed.

Most of the sorts of resources you might need to clean up already have
cleanup mechanisms, so it's not entirely clear that you even *need*
a cleanup proc.  Maybe a different way to say that is that Postgres
already has a pretty well-defined cleanup philosophy, and it's geared
to particular resources (memory, open files, etc) not to individual
called functions.  You should consider swimming with that tide rather
than against it.

I have no objection to adding another field to FmgrInfo for the callee's
use, if you can show an example or two where it'd be useful.  I'm only
concerned about the callback-on-delete part.  That sounds like a recipe
for fragility...
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Horst Herb
Дата:
Сообщение: Re: RFC: CRC datatype
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: COPY BINARY file format proposal