Re: how to correctly react on exception in pfree function?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: how to correctly react on exception in pfree function?
Дата
Msg-id 887967.1665630505@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: how to correctly react on exception in pfree function?  (Julien Rouhaud <rjuju123@gmail.com>)
Ответы Re: how to correctly react on exception in pfree function?  (Julien Rouhaud <rjuju123@gmail.com>)
Список pgsql-hackers
Julien Rouhaud <rjuju123@gmail.com> writes:
> We can change the API to accept an optional new value (and the few other needed
> information) when cleaning the old one, but that's adding some complication
> just to deal with a possible error in pfree.  So it still unclear to me what to
> do here.

I think it's worth investing some effort in ensuring consistency
of persistent data structures in the face of errors.  I doubt it's
worth investing effort in avoiding leaks in the face of errors.
In any case, thinking of it in terms of "trapping" errors is the
wrong approach.  We don't have a cheap or complication-free way
to do that, mainly because you can't trap just one error cause.

It may be worth looking at the GUC code, which has been dealing
with the same sorts of issues pretty successfully for many years.

            regards, tom lane



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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: how to correctly react on exception in pfree function?
Следующее
От: Julien Rouhaud
Дата:
Сообщение: Re: how to correctly react on exception in pfree function?