Allow custom parameters with more than one dot in config files. - Mailing list pgsql-hackers

From Alexander Kukushkin
Subject Allow custom parameters with more than one dot in config files.
Date
Msg-id CAFh8B==xZ_qJNPtyajD5FSZbLKKXiOKv9Hoj08vcUHeo1rcoqw@mail.gmail.com
Whole thread Raw
Responses Re: Allow custom parameters with more than one dot in config files.
List 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

pgsql-hackers by date:

Previous
From: Sergei Kornilov
Date:
Subject: Re:pg_waldump
Next
From: Christophe Pettus
Date:
Subject: Re: logical decoding and replication of sequences, take 2