[Pkg-postgresql-private] System for managing multiple postmasters?

Oliver Elphick olly@lfix.co.uk
Mon, 13 Oct 2003 18:38:41 +0100


This is part of a message I sent to the PostgreSQL general mailing list.
No one has opposed it and one person would like to see it.  What do you
think?


I am not happy about the current situation for Debian upgrading, which
seems to be pretty fragile.  There are a fair number of bug reports from
people for whom the upgrade has barfed in some way or other.  The
situation for RPMs is even worse, since the installation scripts are far
more rigidly constrained than are the Debian installation scripts.  Of
course, that's why Lamar and I would be so happy to see a working
pg_upgrade tool.  But there's no prospect of that in even the medium
term, as far as I can see.

Your suggestion of parallel installations is the solution I have been
considering.  If the new package could be installed alongside the old,
there would be no need to upgrade the data during installation and no
danger of data loss.

Another reason for considering this is for the benefit of people who
want to run multiple versions.  Perhaps they have an application which
is live and they want to keep that going while they update its code for
use with the new PostgreSQL; it will be much easier for them if the two
versions can be installed side by side as packages.  Other users may
have multiple database users, who want to use different software
versions.

For that to work, however, we need a mechanism for assigning a port to
each package and database and for determining which version of the
client software each user will get.  So that means that in each package,
psql must be renamed psql-7.3, psql-7.4 and so on.  Then psql becomes a
soft link to the default psql version.  Debian's alternatives system
(update-alternatives(8)) provides a convenient mechanism for making
those soft links if there is a single systemwide default, but not if
there are different users who want different versions.  I don't know if
Red Hat has anything similar.

At the same time, I would like to make the packages cope with multiple
database structures, which are also needed by ISPs and others who need
to charge users for space used.

Assuming multiple versions installed simultaneously, with multiple
data/base structures

DB struct
owner          PGDATA               Version           PGPORT

fred         /var/lib/pg/fred       7.3               5433
george       /var/lib/pg/george     7.4               5434
harry        /var/lib/pg/harry      7.4               5435

then the packages need to provide the means for each user to get the
right PGPORT and the appropriate client software to access that port.

I haven't got any further than this, but I wonder if this is something
that would be useful to the whole project and not just to the
distributions.  Any comments?

-- 
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "And he shall judge among the nations, and shall rebuke
      many people; and they shall beat their swords into 
      plowshares, and their spears into pruninghooks; nation
      shall not lift up sword against nation, neither shall 
      they learn war any more."       Isaiah 2:4