Re: Parsing config files in a directory

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parsing config files in a directory
Date: 2009-10-24 16:34:36
Message-ID: 9837222c0910240934v60287d43r7980efdee15998fb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2009/10/24 Simon Riggs <simon(at)2ndquadrant(dot)com>:
> On Sat, 2009-10-24 at 15:41 +0200, Magnus Hagander wrote:
>
>> Per discussion at the developer meeting back in Ottawa, attached is an
>> initial patch that implements reading a directory of configuration
>> files instead of just one. The idea being that something like a tuning
>> tool, or pgadmin, for example can drop and modify files in this
>> directory instead of modifying the main config file (which can be very
>> hard to machine-parse). The idea is the same as other software like
>> apache that parses multiple files.
>>
>> Files are parsed in alphabetical order so it's predictable, and you
>> can make sure some files override others etc.
>>
>> Comments, before I go do the final polishing? :-)
>
> I really don't like this at all. It seems like too much change. The
> whole world knows about postgresql.conf, lets not change that.

We're not. It will still be there, just like before. We're just adding
one more way to do it.

> I'm happy with the new feature, however, so is there a way to do this?
>
> Could we have a new directive in postgresql.conf that allows you to
> specify an includedirectory? Like an include directive but for a whole
> directory rather than just a file.

We could do it that way, but that would make the change bigger, not smaller :-P

> Users would then also be able to
> specify more than one directory, if required. This way we would allow
> people to have the multi-conf file feature but without changing existing
> ways of working. By default, we would have one entry at the bottom of
> postgresql.conf which would point to pg_conf, a new directory that
> starts off empty. So by default, nothing has changed, yet the new
> feature is allowed.

Did you look at the patch? That's basically what it does now, except
it doesn't add a parameter in postgresql.conf. If you lkeave the
pg_config directory empty, it will just parse the postgresql.conf file
just like before, and that's it. only if you put something in the
pg_config directory will it load it, and only *after* it has loaded
the main configuration file.

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2009-10-24 16:51:19 Re: Parsing config files in a directory
Previous Message Magnus Hagander 2009-10-24 16:32:31 Re: Parsing config files in a directory