Re: Parsing config files in a directory

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Smith <gsmith(at)gregsmith(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Magnus Hagander <magnus(at)hagander(dot)net>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Parsing config files in a directory
Date: 2009-10-26 23:41:02
Message-ID: 407d949e0910261641k1c422ff2ud3910b503d3b51f8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Oct 26, 2009 at 3:30 PM, Josh Berkus <josh(at)agliodbs(dot)com> wrote:
> Greg,
>
>> This actually seems like a bad idea to me.
>
> You write your tool your way, I'll write my tool mine.  We'll see which
> one works the best in the field.

Yeah actually I meant to but YMMV on that comment and forgot.

>
>> Well you're assuming there's only one tool generating this config? We
>> have at least two and possibly more. initdb generates an initial set
>> of defaults, the user may well run some kind of autotuning program,
>> and then they also have variables set by SET PERSISTENT. That's three
>> pieces of configuration being edited by different pieces of software.
>
> Well, that's what I'd call a bad idea.  Mixing external autotuner which
> writes to files with SET PERSISTENT?

Well you'll need a story for that. You can't stop users from doing SET
PERSISTENT and you'll probably want to adjust some of the variables
that initdb sets up too.

I'm thinking a typical postgresql.d directory would contain
00initdb.conf
50autotuner.conf
99persistent.conf

And also of course read postgresql.conf for any manual settings.

When you run autotuner you could either check if any variables have a
source which comes after 50autotuner.conf and take them into account
or just dump your settings into 50autotuner.conf and then give a
warning if any of them are overridden.

Likewise I would expect SET PERSISTENT to check if any variables have
a source which comes later than 99persistent.conf (namely
postgresql.conf normally) and give a warning. (but still dump the
variable into the 99persistent.conf file)

--
greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-10-26 23:42:39 Re: per-tablespace random_page_cost/seq_page_cost
Previous Message Greg Stark 2009-10-26 23:35:24 Re: per-tablespace random_page_cost/seq_page_cost