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: Disallow setting bogus GUCs within an extension's reserved names
Date: Mon, 21 Feb 2022 19:11:09 +0000
Message-ID: <E1nME5V-0001at-UA@gemulon.postgresql.org> (raw)

Disallow setting bogus GUCs within an extension's reserved namespace.

Commit 75d22069e tried to throw a warning for setting a custom GUC whose
prefix belongs to a previously-loaded extension, if there is no such GUC
defined by the extension.  But that caused unstable behavior with
parallel workers, because workers don't necessarily load extensions and
GUCs in the same order their leader did.  To make that work safely, we
have to completely disallow the case.  We now actually remove any such
GUCs at the time of initial extension load, and then throw an error not
just a warning if you try to add one later.  While this might create a
compatibility issue for a few people, the improvement in error-detection
capability seems worth it; it's hard to believe that there's any good
use-case for choosing such GUC names.

This also un-reverts 5609cc01c (Rename EmitWarningsOnPlaceholders() to
MarkGUCPrefixReserved()), since that function's old name is now even
more of a misnomer.

Florin Irion and Tom Lane

Discussion: https://postgr.es/m/1902182.1640711215@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/88103567cb8fa5be46dc9fac3e3b8774951a2be7

Modified Files
--------------
contrib/auth_delay/auth_delay.c                    |  2 +-
contrib/auto_explain/auto_explain.c                |  2 +-
contrib/basic_archive/basic_archive.c              |  2 +-
contrib/pg_prewarm/autoprewarm.c                   |  2 +-
contrib/pg_stat_statements/pg_stat_statements.c    |  2 +-
contrib/pg_trgm/trgm_op.c                          |  2 +-
contrib/postgres_fdw/option.c                      |  2 +-
contrib/sepgsql/hooks.c                            |  2 +-
src/backend/utils/misc/guc.c                       | 79 ++++++++++++++++++----
src/include/utils/guc.h                            |  5 +-
src/pl/plperl/plperl.c                             |  2 +-
src/pl/plpgsql/src/pl_handler.c                    |  2 +-
src/pl/tcl/pltcl.c                                 |  4 +-
src/test/modules/delay_execution/delay_execution.c |  2 +-
.../ssl_passphrase_callback/ssl_passphrase_func.c  |  2 +-
src/test/modules/worker_spi/worker_spi.c           |  2 +-
src/test/regress/expected/guc.out                  | 11 +++
src/test/regress/sql/guc.sql                       |  7 ++
18 files changed, 101 insertions(+), 31 deletions(-)



Message-ID: <E1nME5V-0001at-UA@gemulon.postgresql.org>
Permalink:  ../E1nME5V-0001at-UA@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nME5V-0001at-UA@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: Disallow setting bogus GUCs within an extension's reserved names
  In-Reply-To: <E1nME5V-0001at-UA@gemulon.postgresql.org>
  References: <E1nME5V-0001at-UA@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