On Mon, Nov 24, 2014 at 3:26 PM, Thom Brown <t...@linux.com> wrote:
> I haven't seen this mentioned anywhere (although it may have as I haven't
> read through the entire history of it), but would others find it useful to
> have ALTER SYSTEM support comments?

Oh, please no.

The main thing that caused us to have no way of modifying
postgresql.conf via SQL for so many years is that it's not clear how
you can sensibly rewrite a file with comments in it.  For example, the
default postgresql.conf file has stuff like this in it:

#variable = someval

If variable gets set to a non-default value, you might want to
uncomment that line, but now you have to parse the comments, which
will be tedious and error-prone and sometimes make stupid decisions:

#Back in days of yore when dinosaurs ruled the earth, we had
#autovacuum_naptime=1h, but that turned out to be a bad idea.
#
#autovacuum_naptime=1min

It's hard for a non-human to know that the second one is the one that
you should uncomment.  There are lots of other problems that arise,
too; this is just an example.

It would perhaps be OK to have comments in postgresql.conf.auto if
they were designated in some way that told us which specific comment
was associated with which specific setting.  But we need to be very
careful not to design something that requires us to write a parser
that can ferret out human intent from context clues.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to