]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Avoid holding a directory FD open across assorted SRF calls.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 17 Mar 2020 01:05:29 +0000 (21:05 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 17 Mar 2020 01:05:53 +0000 (21:05 -0400)
commit2a89455aade3e917b6b0d02d9ce385049d0525eb
tree6e6ec1014089ef38e8f03b07dc9aa7e77e62018e
parentf340977a4fab20f1898d4ac61ae1c36031e109cb
Avoid holding a directory FD open across assorted SRF calls.

This extends the fixes made in commit 085b6b667 to other SRFs with the
same bug, namely pg_logdir_ls(), pgrowlocks(), pg_timezone_names(),
pg_ls_dir(), and pg_tablespace_databases().

Also adjust various comments and documentation to warn against
expecting to clean up resources during a ValuePerCall SRF's final
call.

Back-patch to all supported branches, since these functions were
all born broken.

Justin Pryzby, with cosmetic tweaks by me

Discussion: https://postgr.es/m/20200308173103.GC1357@telsasoft.com
contrib/adminpack/adminpack.c
contrib/pgrowlocks/pgrowlocks.c
doc/src/sgml/xfunc.sgml
src/backend/utils/adt/datetime.c
src/backend/utils/adt/genfile.c
src/backend/utils/adt/misc.c
src/backend/utils/fmgr/README
src/include/funcapi.h
src/test/regress/expected/misc_functions.out
src/test/regress/sql/misc_functions.sql