Skip site navigation (1) Skip section navigation (2)

Re: Parsing config files in a directory

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Greg Stark <gsstark(at)mit(dot)edu>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Smith <gsmith(at)gregsmith(dot)com>, Dimitri Fontaine <dfontaine(at)hi-media(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parsing config files in a directory
Date: 2009-10-28 02:29:33
Message-ID: 603c8f070910271929v19e24370xbcdf9241989b0367@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackers
On Tue, Oct 27, 2009 at 9:05 PM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
>> The Apache model is definitely the first of these, AFAICS.  The
>> proposals on this thread mostly seem to be an amalgam of both, which
>> doesn't strike me as a terribly good idea, but evidently I'm in the
>> minority.
>
> Well, an individual DBA would not want to do it both ways.  But we
> should *allow* both ways rather than trying to mandate how the files get
> created or what their names are.

I guess all I'm saying is that if we took the approach of making SET
PERSISTENT rewrite postgresql.conf, we actually could let people do it
either way they pleased without the complexity of having multiple
files.

The only reason we can't do that today is because postgresql.conf
contains unparseable comments.  The only way to fix that problem
completely is, as Tom says, to remove the ability to have comments.
But that seems like overkill.  If we simply removed most of the
comments that are there by default, then we could say: "You can edit
this file with a text editor.  Or you can edit it using SET
PERSISTENT.  Or you can do both.  But if you do both, your comments
may end up getting moved relative to your settings.  So if you care
about that, then don't use SET PERSISTENT.  In fact, if you want,
there's a GUC called enable_set_persistent that you can set to false."

That seems like a win for everyone.  People who want to use a text
editor can do so.  People who want to use SET PERSISTENT can do so.
People who want to do both can do so, too, and without the confusion
of having two different places for settings one of which will override
the other.  I think the only people who will be unhappy are (1) people
who like the current really long postgresql.conf [but the previous
discussion of this topic suggested there weren't too many of those]
and (2) people who want to edit postgresql.conf by hand AND want to
edit it with SET PERSISTENT AND can't stand having their comments
shuffled around relative to their settings [but these people will
never be happy no matter what we do].

But evidently this is not such a good idea as I think it is, or else
I've been explaining it really, really badly.

...Robert

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2009-10-28 02:53:15
Subject: Re: Parsing config files in a directory
Previous:From: Itagaki TakahiroDate: 2009-10-28 02:27:35
Subject: pg_read_file() and non-ascii input file

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group