Re: pg_config, pg_service.conf, postgresql.conf ....

From: Martin Pitt <mpitt(at)debian(dot)org>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_config, pg_service.conf, postgresql.conf ....
Date: 2006-02-23 11:42:52
Message-ID: 20060223114252.GE5841@piware.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Mark, hi Martijn!

Martijn van Oosterhout [2006-02-23 12:10 +0100]:
> If you're talking about standards perhaps you should consider how
> Debian does it. All configuration is stored in
>
> /etc/postgresql/<version>/<clustername>/
>
> It provides wrapper scripts to run pg_ctl (pg_ctlcluster) on any
> particular cluster which can be run by either the system user owning
> the db, or root.
>
> Within those files is all the information required to find the cluster
> (base directory, etc).

Right. But although this fits well for Debian, this is not necessarily
the case for other Linux distributions, let alone non-Linux systems.
Even less when using the upstream tarball (where all configuration is
usually kept in the data directory itself).

However, Debian has a tool 'pg_lsclusters' which comes pretty close to
what Mark wants, AFAICS:

$ pg_lsclusters
Version Cluster Port Status Owner Data directory Log file
7.4 main 5432 online postgres /var/lib/postgresql/7.4/main /var/log/postgresql/postgresql-7.4-main.log
8.1 main 5434 down postgres /var/lib/postgresql/8.1/main /var/log/postgresql/postgresql-8.1-main.log
8.1 test 5433 online martin /home/martin/psql /var/log/postgresql/postgresql-8.1-test.log

So, even in the current Debian system we don't have a fixed location
for the data directories, log files, etc. There are defaults, but they
can be customized, for good reasons (like keeping my test cluster in
my home directory, and so on).

> I think the default config is to start all clusters on bootup.

Right; this is customizable in a file start.conf
(auto|manual|disabled) in the cluster configuration directory.

> The main downside of this system is that some sysadmin pretty much
> needs to create the clusters for everyone.

What do you mean in particular? The packages install a default cluster
(e. g. postgresql-8.1 creates a cluster 8.1/main), more clusters can
be created with pg_createcluster.

> I doubt something like this would ever make it into the standard
> distribution though. What you're asking is more a distributer issue
> than an issue for postgres.

I agree. Also, FYI, a while ago I proposed some patches which allow
several major versions to be installed in parallel, but they were
deemed too specific for upstream inclusion (which is fine; it's the
distributor's task to integrate an application into a distribution's
file layout/configuration handling/other quirks).

Thanks,

Martin
--
Martin Pitt http://www.piware.de
Ubuntu Developer http://www.ubuntu.com
Debian Developer http://www.debian.org

In a world without walls and fences, who needs Windows and Gates?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-02-23 11:44:47 Re: Join with an array
Previous Message Markus Schiltknecht 2006-02-23 11:36:35 Join with an array