Re: PostgreSQL configuration - Mailing list pgsql-hackers

From Tom Lane
Subject Re: PostgreSQL configuration
Date
Msg-id 11672.1081790366@sss.pgh.pa.us
Whole thread Raw
In response to Re: PostgreSQL configuration  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: PostgreSQL configuration  (Kevin Brown <kevin@sysexperts.com>)
List pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> pgsql@mohawksoft.com wrote:
> What if someone does -C /var/data/postgresql.conf, and postgresql.conf
> say to use /usr/local/data for data, what do we do?

Well, the patch says that the command line switch wins, which is
consistent with what we do for other command line switches (they all
override the equivalent postgresql.conf entries).  This does seem a
bit at variance with the stated goal of making the configuration more
clearly documented, though :-(.  If you actually use the capability then
your config file will be lying to you about where things are.

It's worth pointing out in this connection that for the most part
I think people are moving *away* from using command line switches;
it's better to set the value in postgresql.conf, both for documentation
reasons and because that way you have some chance of changing the value
via config file update and SIGHUP.  The only way to change a value on
the command line is to restart the postmaster.  Plus, if you're using a
distribution-supplied init script to start the postmaster, it's hard to
get any switches in without hacking the script anyway.

Most of these objections also apply to values obtained from environment
variables (the exception is that postgresql.conf can override
environment variables).

So all in all I feel that we don't want to encourage more use of command
line switches or environment variables to configure the postmaster.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Solaris initdb fails: shmmax tweak alternative?
Next
From: Peter Eisentraut
Date:
Subject: Re: PostgreSQL configuration