Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction
Дата
Msg-id 20925.1584021938@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Список pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> I wonder if this isn't saying that the whole value-per-call protocol is
> bogus, in that it seems impossible to write a useful function with it.

Only if you have a *very* narrow definition of "useful function".
If you look through SRF_RETURN_DONE callers, only a small minority
are trying to do resource cleanup beforehand.

> Maybe we should add one final call with a special flag "function
> shutdown" or something, so that these resources can be released if the
> SRF isn't run to completion?

We already have an appropriate mechanism for cleaning up resources,
ie RegisterExprContextCallback.  I do not think what you're suggesting
could be made to work without an incompatible break in the API for
SRFs, so it's not an improvement over telling people more forcefully
about how to do resource cleanup correctly.

            regards, tom lane



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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: Collation versioning
Следующее
От: Amit Kapila
Дата:
Сообщение: Re: [PATCH] Add schema and table names to partition error