Re: [PATCH] Fix ALTER SYSTEM empty string bug for GUC_LIST_QUOTE parameters

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Cc: Andrei Klychkov <andrew(dot)a(dot)klychkov(at)gmail(dot)com>, Jim Jones <jim(dot)jones(at)uni-muenster(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: [PATCH] Fix ALTER SYSTEM empty string bug for GUC_LIST_QUOTE parameters
Date: 2025-09-04 21:52:49
Message-ID: 1235943.1757022769@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> 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.

I tried to work through what this'd imply, and arrived at the attached
patch. I might've missed some places, and I did not think about what
documentation updates would be appropriate.

Note that the patch includes changing SplitIdentifierString and its
clones to forbid zero-length quoted elements, which were formerly
allowed. Without this, we'd accept values from config files that
could not be represented in SET, which is exactly the situation we
are trying to fix.

I'm not entirely sure if this is the way to go, or if we want to
adopt some other solution that doesn't involve forbidding empty
list elements. I suspect that anything else we come up with would
be less intuitive than letting SET list_var = '' do the job;
but maybe I just lack imagination today.

regards, tom lane

Attachment Content-Type Size
v3-allow-SET-to-an-empty-list.patch text/x-diff 15.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Curtis 2025-09-04 22:09:57 Fix race condition in SSI when reading PredXact->SxactGlobalXmin
Previous Message Masahiko Sawada 2025-09-04 21:34:19 Re: Logical Replication of sequences