Re: postgresql.auto.conf comments - Mailing list pgsql-hackers

From Robert Haas
Subject Re: postgresql.auto.conf comments
Date
Msg-id CA+TgmoZBDLhDexHyTJ=H0xZt7-6M=h+v2Xi0Myj7Q37QGZQb4g@mail.gmail.com
Whole thread Raw
In response to postgresql.auto.conf comments  (Thom Brown <thom@linux.com>)
Responses Re: postgresql.auto.conf comments  (Thom Brown <thom@linux.com>)
List pgsql-hackers
On Mon, Nov 24, 2014 at 3:26 PM, Thom Brown <thom@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



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}
Next
From: Thom Brown
Date:
Subject: Re: postgresql.auto.conf comments