Avoid holding a directory FD open across assorted SRF calls.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 2a89455aade3e917b6b0d02d9ce385049d0525eb
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2020-03-17T01:05:53Z
Releases: 12.3
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

Files

Documentation touched

Discussion