pgsql: Avoid holding a directory FD open across assorted SRF calls.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Avoid holding a directory FD open across assorted SRF calls.
Date: 2020-03-17 01:06:13
Message-ID: E1jE0gP-0002n3-Ab@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/da254148f4deff3cc5f4a5003e5b3c026c04f4a9

Modified Files
--------------
contrib/adminpack/adminpack.c | 80 ++++++++++++------------
contrib/pgrowlocks/pgrowlocks.c | 124 ++++++++++++++++--------------------
doc/src/sgml/xfunc.sgml | 98 ++++++++++++++++++-----------
src/backend/utils/adt/datetime.c | 101 ++++++++++++------------------
src/backend/utils/adt/genfile.c | 105 ++++++++++++++++---------------
src/backend/utils/adt/misc.c | 131 +++++++++++++++++++++------------------
src/backend/utils/fmgr/README | 16 +++--
src/include/funcapi.h | 13 +++-
8 files changed, 342 insertions(+), 326 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2020-03-17 01:36:57 pgsql: Remove useless pfree()s at the ends of various ValuePerCall SRFs
Previous Message Peter Geoghegan 2020-03-16 22:51:51 pgsql: nbtree: Fix obsolete _bt_search() comment.