[Pkg-postgresql-private] Replacing cluster_ports by something better

Martin Pitt mpitt@debian.org
Sun, 23 Jan 2005 19:19:07 +0100


--yrj/dFKFPuw6o+aM
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi!

I currently try to make the PostgreSQL 8.0 packages actually install
and start properly, so I work on a postgresql-common init script which
starts up all configured postmasters. During this I thought about
the current /etc/postgresql/cluster_ports, which I have some problems
with:

1. Why do we need  (potentially) several postmaster instances for one
   major version in the first place? Having two system-wide 8.0
   postmasters does not make sense, and if users want to run their own
   private postmaster on their own database directory, then they
   cannot use the system-wide infrastructure anyway, because this
   would require root privileges.

   AFAICS we should stick to managing exactly one postmaster instance
   per installed major version, which would greatly simplify the
   architecture.=20

   Sorry for discussing this so late, but I never really thought about
   this before actually working on psql 8.

2. cluster_ports is currently a configuration file, and as such we
   must be _very_ careful in automatically modifying it at e. g.
   package installation.

3. cluster_ports contains a lot of redundancy, which should be
   avoided:

   CLUSTER: not necessary _if_ we only support one instance (see 1.)
   STATUS: this is okay
   OWNER: should always be postgres
   VERSION: already in CLUSTERPATH/PG_VERSION
   PORT: already in CLUSTERPATH/postmaster.conf
         (=3D=3D /etc/postgresql/VERSION/postmaster.conf)
   CLUSTERPATH: this seems okay to me, too

Proposal:
---------

If we support just one cluster per major version, we rely on the
existence of /etc/postgresql/$MAJOR_VERSION/, in the case of several
clusters we rely on /etc/postgresql/$CLUSTERNAME/. This directory
contains all configuration files.

cluster_ports will be dropped entirely; instead, the relevant data
(STATUS and CLUSTERPATH) is put into a new conffile
/etc/postgresql/$CLUSTER/status and a symlink
/etc/postgresql/$CLUSTER/pgdata which points to the actual data
directory.

The purpose user_clusters seems to be sensible to me, so I would just
leave it as it is by now. However, what is GROUP for?

Thanks for any comments!

Martin

--=20
Martin Pitt                       http://www.piware.de
Ubuntu Developer            http://www.ubuntulinux.org
Debian GNU/Linux Developer       http://www.debian.org

--yrj/dFKFPuw6o+aM
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFB8+qbDecnbV4Fd/IRAnnsAKC6oCPYXQbdiPMz9pKPyAaOKqpVrACgyDHD
fvmVYAAQ1mjOA31/DVWsr5Q=
=QpwS
-----END PGP SIGNATURE-----

--yrj/dFKFPuw6o+aM--