From: Tom Lane <tgl@sss.pgh.pa.us>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Andrei Klychkov <andrew.a.klychkov@gmail.com>
Cc: Jim Jones <jim.jones@uni-muenster.de>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: [PATCH] Fix ALTER SYSTEM empty string bug for GUC_LIST_QUOTE parameters
Date: Thu, 04 Sep 2025 14:24:48 -0400
Message-ID: <1056071.1757010288@sss.pgh.pa.us> (raw)
In-Reply-To: <1046095.1757007639@sss.pgh.pa.us>
References: <CA+mfrmwsBmYsJayWjc8bJmicxc3phZcHHY=yW5aYe=P-1d_4bg@mail.gmail.com>
<38091678-2820-4bc8-8df7-b417562f7860@uni-muenster.de>
<CA+mfrmxtk+f3dE8zJ2=5cWrbSw6YzOXNOmbi1iC0Hb0HCa-G7w@mail.gmail.com>
<CAHGQGwG7ADhPorp0-29LGz0Vct=Dhhcerb8LdX2s+QC7TY=RRA@mail.gmail.com>
<CA+mfrmwJgd3N1Lcqy64Fi6R+JHAT=bhf6rdh52hMRH78pBM5mQ@mail.gmail.com>
<CAHGQGwEqxZ81JrJ+fO=8sYGFYTgrZ-M6XYErdLoiy8p82EXS-A@mail.gmail.com>
<1046095.1757007639@sss.pgh.pa.us>
I wrote:
> We might want to start resolving this by inventing a syntax for
> setting a list GUC to an empty list. I'm not very sure what that
> should look like, except that it mustn't be SET ... TO ''.
I experimented with the idea of allowing
SET var TO ;
and got a bunch of shift-reduce conflicts from bison, which don't
look easy to avoid. It's probably a bit too surprising anyway.
This works from a grammar standpoint:
SET var TO NULL;
Because NULL is fully reserved, this isn't usurping any cases that
weren't syntax errors before. It might still be too surprising.
Another idea is that we could redefine a single '' as meaning an empty
list if we were to forbid empty strings as members of GUC_LIST_QUOTE
variables. This doesn't look like it'd be a big issue for the current
set of such variables:
local_preload_libraries
search_path
session_preload_libraries
shared_preload_libraries
temp_tablespaces
unix_socket_directories
We might break some applications that're relying on the current
behavior that an empty item would be effectively ignored.
But that seems a bit remote, and anyway they could just switch
to some other nonexistent name.
Actually, looking at the small number of GUCs that are marked
GUC_LIST_INPUT but not GUC_LIST_QUOTE, I wonder if we shouldn't
prohibit empty strings across-the-board for GUC_LIST_INPUT GUCs.
I don't see any where it'd be useful to allow them. Then we
could allow '' to mean empty list for all of them.
regards, tom lane
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, masao.fujii@gmail.com, andrew.a.klychkov@gmail.com, jim.jones@uni-muenster.de, pgsql-hackers@lists.postgresql.org
Subject: Re: [PATCH] Fix ALTER SYSTEM empty string bug for GUC_LIST_QUOTE parameters
In-Reply-To: <1056071.1757010288@sss.pgh.pa.us>
* 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