public inbox for [email protected]  
help / color / mirror / Atom feed
BUG #19538: ALTER SYSTEM adds extra quotes
2+ messages / 2 participants
[nested] [flat]

* BUG #19538: ALTER SYSTEM adds extra quotes
@ 2026-06-29 08:08 PG Bug reporting form <[email protected]>
  2026-06-29 13:55 ` Re: BUG #19538: ALTER SYSTEM adds extra quotes Tom Lane <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: PG Bug reporting form @ 2026-06-29 08:08 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

The following bug has been logged on the website:

Bug reference:      19538
Logged by:          Gábor Szabó
Email address:      [email protected]
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.







^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: BUG #19538: ALTER SYSTEM adds extra quotes
  2026-06-29 08:08 BUG #19538: ALTER SYSTEM adds extra quotes PG Bug reporting form <[email protected]>
@ 2026-06-29 13:55 ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2026-06-29 13:55 UTC (permalink / raw)
  To: [email protected]; +Cc: [email protected]

PG Bug reporting form <[email protected]> writes:
> 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

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






^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2026-06-29 13:55 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-06-29 08:08 BUG #19538: ALTER SYSTEM adds extra quotes PG Bug reporting form <[email protected]>
2026-06-29 13:55 ` Tom Lane <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox