Re: PostgreSQL configuration

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql(at)mohawksoft(dot)com, Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>, rm_pg(at)cheapcomplexdevices(dot)com, Christopher Browne <cbbrowne(at)acm(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL configuration
Date: 2004-04-12 17:19:26
Message-ID: 11672.1081790366@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> pgsql(at)mohawksoft(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2004-04-12 17:26:13 Re: PostgreSQL configuration
Previous Message Andrew Sullivan 2004-04-12 17:14:53 Re: Solaris initdb fails: shmmax tweak alternative?