Subject: BUG #19538: ALTER SYSTEM adds extra quotes

From: PG Bug reporting form <[email-masked]>
Date: Mon, 29 Jun 2026 08:08:57 +0000

The following bug has been logged on the website:

Bug reference:      19538
Logged by:          Gábor Szabó
Email address:      [email-masked]
PostgreSQL version: 14.23
Operating system:   Ubuntu 24.04.4
Description:        

The following command adds extra quotes to postgresql.auto.conf:
ALTER SYSTEM SET shared_preload_libraries = 'pg_stat_statements, auth_delay,
auto_explain, pg_prewarm';
The result entry in postgresql.auto.conf is:
shared_preload_libraries = '"pg_stat_statements, auth_delay, auto_explain,
pg_prewarm"'
As a result, PostgreSQL tries to load the entire string as a single library
name and reports the following error in /var/log/postgresql:
FATAL:  could not access file "pg_stat_statements, auth_delay, auto_explain,
pg_prewarm": Nincs ilyen fájl vagy könyvtár

("Nincs ilyen fájl vagy könyvtár" is the Hungarian translation of "No such
file or directory", because the server is running with the hu_HU.UTF-8
locale)

When I run ALTER SYSTEM SET shared_preload_libraries = 'pg_stat_statements';
It works correctly and the resulting entry is:
shared_preload_libraries = 'pg_stat_statements'

However, when the value contains commas, the extra double quotes appear
around the entire string.
I also tried using double quotes in the ALTER SYSTEM command, but the result
was the same.

I reproduced the same behavior on my development system running PostgreSQL
18.4 on Windows.

---

From: Tom Lane <[email-masked]>
Date: Mon, 29 Jun 2026 09:55:05 -0400

> pg_prewarm": Nincs ilyen fájl vagy könyvtár

This behavior is correct; what's wrong is the SQL syntax you used.
You should have written

ALTER SYSTEM SET shared_preload_libraries = pg_stat_statements, auth_delay,
auto_explain, pg_prewarm;

since what you are providing is a list, not a single value that
happens to contain some commas.  (It wouldn't matter in this case
whether you quote the individual values; though if any of them match
a SQL reserved word, it'd need quotes.)

I know this is confusing, because the rules are different when you
are writing a list directly in postgresql.conf.  But, well, SQL is
not postgresql.conf.

			regards, tom lane