Allow custom parameters with more than one dot in config files.

From: Alexander Kukushkin <cyberdemn(at)gmail(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Allow custom parameters with more than one dot in config files.
Date: 2023-12-19 12:25:08
Message-ID: CAFh8B==xZ_qJNPtyajD5FSZbLKKXiOKv9Hoj08vcUHeo1rcoqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hacker,

At the moment the only requirement for custom parameter names is that they
should have one or more dots.
For example:
test5=# set a.b.c.d = 1;
SET
test5=# show a.b.c.d;
a.b.c.d
---------
1
(1 row)

But, Postgres fails to start if such parameters are set in the
configuration file with the following error:
LOG: syntax error in file "/tmp/cluster/postgresql.auto.conf" line 8, near
token "a.b.c.d"
FATAL: configuration file "postgresql.auto.conf" contains errors

What is more fun, ALTER SYSTEM allows writing such parameters to the
postgresql.auto.conf file if they are defined in a session:
test5=# show a.b.c.d;
ERROR: unrecognized configuration parameter "a.b.c.d"
test5=# alter system set a.b.c.d = 1;
ERROR: unrecognized configuration parameter "a.b.c.d"
test5=# set a.b.c.d = 1;
SET
test5=# alter system set a.b.c.d = 1;
ALTER SYSTEM

In my opinion it would be fair to make parsing of config files with the
rest of the code responsible for GUC handling by allowing custom parameters
containing more than one dot.
The fix is rather simple, please find the patch attached.

Regards,
--
Alexander Kukushkin

Attachment Content-Type Size
v1-0001-multidot-custom-params.patch text/x-patch 916 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christophe Pettus 2023-12-19 12:54:32 Re: logical decoding and replication of sequences, take 2
Previous Message Sergei Kornilov 2023-12-19 12:07:07 Re:pg_waldump