Re: postgresql.auto.conf comments

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: postgresql.auto.conf comments
Date: 2014-11-24 21:04:00
Message-ID: CA+TgmoZBDLhDexHyTJ=H0xZt7-6M=h+v2Xi0Myj7Q37QGZQb4g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Nov 24, 2014 at 3:26 PM, Thom Brown <thom(at)linux(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thom Brown 2014-11-24 21:22:45 Re: postgresql.auto.conf comments
Previous Message Peter Geoghegan 2014-11-24 21:03:41 Re: INSERT ... ON CONFLICT {UPDATE | IGNORE}