Re: PostgreSQL configuration

From: Steve Atkins <steve(at)blighty(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: PostgreSQL configuration
Date: 2004-04-11 15:15:21
Message-ID: 20040411151521.GA9391@gp.word-to-the-wise.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Apr 10, 2004 at 03:53:49PM -0400, pgsql(at)mohawksoft(dot)com wrote:
> > The whole idea of having multiple command-line switches to pick config
> > and data separately bothers me. ISTM this would mostly create great new
> > opportunities to shoot yourself in the foot (by accidentally picking the
> > wrong combination), without nearly enough benefit to outweigh the risk.
>
> This is where I think we disagree. Very much so, in fact. I think having
> something like:
>
> /etc/postgres/webdb.conf
> In which there is a line:
> datadir=/RAID0/postgres
>
> and
>
> /etc/postgres/testdb.conf
> In which there is this line
> datadir=/RAID1/postgres
>
> Allows for a very standardized, and IMHO, very self documenting installation.

But not as flexible as the existing alternative.

For instance, what if webdb is PostgreSQL 7.3 and testdb is PostgreSQL
7.4? There is no way you can put that difference in a configuration
file, so the user will still need to know which binary of postgresql
to fire up.

So, yes, let's have a standard directory for storing the configuration
for all the PostgreSQL installations on the machine.

/etc/postgres sounds fine.

In /etc/postgres/webdb:

#!/bin/sh
datadir=/RAID0/postgres
/usr/local/pgsql73/bin/postmaster -D $datadir

and in /etc/postgres/testdb

#!/bin/sh
datadir=/RAID1/postgres
/usr/local/pgsql742/bin/postmaster -D $datadir

Much more flexible and explicitly self-documenting.

For more flexibility still, do what I do and make the scripts standard
rc.d style startup scripts.

To walk a user through listing the supported installations is easy -
'ls /etc/postgres'. Starting and stopping one - '/etc/postgres/webdb start'
or '/etc/postgres/webdb stop'. Checking system status and displaying the
data directory '/etc/postgres/webdb status'.

It seems to me to be far more intuitive to the end user, and to the
typical admin than your -C suggestion, it's certainly safer, and it
works fine now.

Cheers,
Steve

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message pgsql 2004-04-11 15:56:32 Re: PostgreSQL configuration
Previous Message Jeroen T. Vermeulen 2004-04-11 14:28:14 Re: 7.5 beta version