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

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Andrei Klychkov <andrew(dot)a(dot)klychkov(at)gmail(dot)com>
Cc: 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 16:42:06
Message-ID: CAHGQGwEqxZ81JrJ+fO=8sYGFYTgrZ-M6XYErdLoiy8p82EXS-A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Sep 4, 2025 at 4:42 PM Andrei Klychkov
<andrew(dot)a(dot)klychkov(at)gmail(dot)com> wrote:
>
> > Even with this patch, an empty string set via SET is still quoted. For example:
> >
> > =# SET local_preload_libraries TO '';
> > SET
> > =# SHOW local_preload_libraries ;
> > local_preload_libraries
> > -------------------------
> > ""
> > (1 row)
> >
> > Is this behavior acceptable? I was thinking that an empty string should not
> > be quoted, regardless of whether it's set by ALTER SYSTEM SET or SET.
> > Thought?
> >
> > If we agree it should be handled in both cases, flatten_set_variable_args()
> > seems to need to be updated.
>
> Hello Fujii,
> Thanks for your review!
>
> I'm personally not sure because this is my first patch and I'm trying to solve a specific issue of the postgresql.auto.conf-related server crashes.
> If what your *broader-impact* suggestion makes sense to more experienced devs in this area, I'd be happy to update the patch as you put it, test it (as much as I can), and re-submit v3.
> Otherwise, I'd be happy with the v2 implementation that seemingly solves my specific issue.

Yeah, I think my suggestion makes sense.

BTW, regarding the behavior change, I believe that users likely expect
the parameter to be reset when specifying an empty string, rather than
being set to "". So the proposed change seems reasonable. However,
the current behavior has existed for a long time, and I haven’t seen
any complaints about it. Some users may rely on the existing behavior
(I think that’s unlikely, though). So I'm not completely sure yet if this change
should be applied.

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2025-09-04 16:44:37 Re: [PATCH] Fix ALTER SYSTEM empty string bug for GUC_LIST_QUOTE parameters
Previous Message Sami Imseih 2025-09-04 16:32:26 Re: PgStat_HashKey padding issue when passed by reference