Re: location of the configuration files - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: location of the configuration files
Date
Msg-id 200302131917.h1DJHpX04946@candle.pha.pa.us
Whole thread Raw
In response to Re: location of the configuration files  (mlw <pgsql@mohawksoft.com>)
Responses Re: location of the configuration files
List pgsql-hackers
mlw wrote:
> >It doesn't have anything to do with "not-invented-here", which is a
> >common refrain by people who don't like our decisions, like "Why don't
> >you use mmap()?  Oh, it's because I thought of it and you didn't".  Does
> >anyone seriously believe that is the motiviation of anyone in this
> >project!  I certainly don't.
> >
> >Now, on to this configuration discussion.  Seems moving the config file
> >out of $PGDATA requies either:
> >    
> >    1) we specifiy both the config directory and the data directory on
> >    postmaster start
> >    
> >    2) we specify the pgdata directory inside postgresql.conf or
> >    other config file
> >
> >Is this accurate?
> >  
> >
> The patch that I have adds three settings to postgresql.conf and one 
> command line parameter.
> 
> hba_conf = 'filename'
> ident_conf='filename'
> data_dir='path'
> 
> The command linae parameter is  -C, used as:
> 
> postmaster -C /usr/local/etc/postgresql.conf
> 
> I think this will help administrators.
> 
> Bruce, can you shed some light as to why this is being so strongly 
> rejected. I just don't see any downside. I just don't get it.
> 
> I will be resubmitting my patch for the 7.3.2 tree.

Well, in a sense, it trades passing one parameter, PGDATA, for another. 
I see your point that we should specify configuration first, and let
everything pass from there.  However, it does add extra configuration
parameters, and because you still need to specify/create pgdata, it adds
an extra level of abstraction to setting up the server.

Also, there is nothing preventing someone from symlinking the
configuration files from pgdata to somewhere else.

I don't think separate params for each config file is good.  At the
most, I think we will specify the configuration _directory_ for all the
config files, perhaps pgsql/etc, and have pgdata default to ../data, or
honor $PGDATA.  That might be the cleanest.

Of course, that now gives us $PGCONFIG and $PGDATA, and possible
intraction if postgresql.conf specifies a different pgdata from $PGDATA.
As you can see, it could get messy.

And, if you specify pgdata in postgresql.conf, it prevents you from
using that file by different postmasters.

My best guess would be to not specify pgdata in postgresql.conf, and
have a new $PGCONFIG param to specify the configuration directory, but
if we do that, $PGDATA/postgresql.conf becomes meaningless, which could
also be confusing.  Maybe we don't allow those files to exist in $PGDATA
if $PGCONFIG is used, _and_ $PGCONFIG is not the same as $PGDATA.  See,
I am getting myself confused.  :-)

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: location of the configuration files
Next
From: Bruce Momjian
Date:
Subject: Re: Changing the default configuration