pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid holding a directory FD open across assorted SRF calls.
Date: Tue, 17 Mar 2020 01:06:13 +0000
Message-ID: <E1jE0gP-0002mq-82@gemulon.postgresql.org> (raw)

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
------
master

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

Modified Files
--------------
contrib/adminpack/adminpack.c                |  78 ++++++------
contrib/pgrowlocks/pgrowlocks.c              | 173 ++++++++++++---------------
doc/src/sgml/xfunc.sgml                      |  96 +++++++++------
src/backend/utils/adt/datetime.c             | 101 +++++++---------
src/backend/utils/adt/genfile.c              | 112 ++++++++---------
src/backend/utils/adt/misc.c                 | 117 ++++++++++--------
src/backend/utils/fmgr/README                |  16 ++-
src/include/funcapi.h                        |  13 +-
src/test/regress/expected/misc_functions.out |  21 ++++
src/test/regress/sql/misc_functions.sql      |   9 ++
10 files changed, 388 insertions(+), 348 deletions(-)



view thread (10+ messages)

Message-ID: <E1jE0gP-0002mq-82@gemulon.postgresql.org>
Permalink:  ../E1jE0gP-0002mq-82@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jE0gP-0002mq-82@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Avoid holding a directory FD open across assorted SRF calls.
  In-Reply-To: <E1jE0gP-0002mq-82@gemulon.postgresql.org>
  References: <E1jE0gP-0002mq-82@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox