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
8034.1583699444@sss.pgh.pa.us
Ответ на
Список
Дерево обсуждения
pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Justin Pryzby <pryzby@telsasoft.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Justin Pryzby <pryzby@telsasoft.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Justin Pryzby <pryzby@telsasoft.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Justin Pryzby <pryzby@telsasoft.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Alvaro Herrera <alvherre@2ndquadrant.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Justin Pryzby <pryzby@telsasoft.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Justin Pryzby <pryzby@telsasoft.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Justin Pryzby <pryzby@telsasoft.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Justin Pryzby <pryzby@telsasoft.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Justin Pryzby <pryzby@telsasoft.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Fabien COELHO <coelho@cri.ensmp.fr>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Fabien COELHO <coelho@cri.ensmp.fr>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Justin Pryzby <pryzby@telsasoft.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Alexander Lakhin <exclusion@gmail.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Alexander Lakhin <exclusion@gmail.com>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed at end-of-transaction Tom Lane <tgl@sss.pgh.pa.us>
Re: pg11+: pg_ls_*dir LIMIT 1: temporary files .. not closed atend-of-transaction Justin Pryzby <pryzby@telsasoft.com>
I wrote:
> I've just finished scanning the source code and concluding that all
> of these functions are similarly broken:
> pg_ls_dir
> pg_ls_dir_files
> pg_tablespace_databases
> pg_logdir_ls_internal
> pg_timezone_names
> pgrowlocks

BTW, another thing I noticed while looking around is that some of
the functions using SRF_RETURN_DONE() think they should clean up
memory beforehand.  This is a waste of code/cycles, as long as the
memory was properly allocated in funcctx->multi_call_memory_ctx,
because funcapi.c takes care of deleting that context.

We should probably document that *any* manual cleanup before
SRF_RETURN_DONE() is an antipattern.  If you have to have cleanup,
it needs to be done via RegisterExprContextCallback instead.

			regards, tom lane


В списке pgsql-hackers по дате отправления
От: Tom Lane
Дата:
От: Thomas Munro
Дата:
FAQ