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: Make GetConfigOption/GetConfigOptionResetString return "" for NU
Date: Thu, 02 Nov 2023 15:53:42 +0000
Message-ID: <E1qya0r-003brC-Tk@gemulon.postgresql.org> (raw)

Make GetConfigOption/GetConfigOptionResetString return "" for NULL.

As per the preceding commit, GUC APIs generally expose NULL-valued
string variables as empty strings.  Extend that policy to
GetConfigOption() and GetConfigOptionResetString(), eliminating
a crash hazard for unwary callers, as well as a fundamental
ambiguity in GetConfigOption()'s API.

No back-patch, since this is an API change and conceivably somebody
somewhere is depending on this corner case.

Xing Guo, Aleksander Alekseev, Tom Lane

Discussion: https://postgr.es/m/CACpMh+AyDx5YUpPaAgzVwC1d8zfOL4JoD-uyFDnNSa1z0EsDQQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0bc726d95a305ca923b1f284159f40f0d5cf5725

Modified Files
--------------
src/backend/utils/misc/guc.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)



Message-ID: <E1qya0r-003brC-Tk@gemulon.postgresql.org>
Permalink:  ../E1qya0r-003brC-Tk@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qya0r-003brC-Tk@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Make GetConfigOption/GetConfigOptionResetString return "" for NU
  In-Reply-To: <E1qya0r-003brC-Tk@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