[Slackbuilds-users] PostgreSQL - multiple installed versions

Adis Nezirovic adis at linux.org.ba
Wed Sep 11 12:50:02 UTC 2013


Hello guys,

I have test slackbuild (see attachment). The scenario for using package
produced by this
slackbuild would be the following:

1) You don't have PostgreSQL installed. Install package, business as usual

2) You have PostgreSQL installed, don't care for in-place upgrades:
    Create backups, remove/upgrade PostgreSQL, load the backups

3) You have PostgreSQL installed (let's say 9.x series, or at least 8.3)
    You want to do in-place testing (two running PostgreSQL instances) and
upgrade
    using pg_upgrade

3.1) Make sure you have backups

3.2) Build new PostgreSQL 9.3

3.3) Install new PostgreSQL 9.3, while keeping the old package installed as
well
  - Please note that new PostgreSQL will have binaries in
/usr/lib64/postgresql/9.3/bin,
    and install script create symlinks in /usr/bin only if respective
postgresql binaries are
    not found in /usr/bin (i.e. it will _not_ overwrite your PostgreSQL 9.x
binaries!)
  - Libraries will be kept as well (new install location for libraries is
    /usr/lib64/postgresql/9.3/lib)
  - Shared data, documents, include files will be overwritten

3.4) Make sure new rc.postgresql script is active
  - You can manage old PostgreSQL versions (< 9.3) by using:
    PG_VERSION=9.2 /etc/rc.d/rc.postgresql start|stop|...
  - Use PG_VERSION=9.2 for v9.2.x and older PostgreSQL versions
  - You can even specify port (port number is used for sockets as well):
    PG_VERSION=9.2 PG_PORT=6432 /etc/rc.d/rc.postgresql

3.5) Initialize the new PostgreSQL cluster as suggested by README file

3.6) Stop old and new cluster

3.7) Use pg_upgrade to import your data, e.g.
  /usr/lib64/postgresql/9.3/bin/pg_upgrade -v -b /usr/bin -B
/usr/lib64/postgresql/9.3/bin \
  -d /var/lib/pgsql/data -D /var/lib/pgsql/9.3/data


Please remember that at this point, binaries in /usr/bin are still the old
v9.2 binaries. When
you remove old PostgreSQL package, you should create symlinks to the
programs in
/usr/lib64/postgresql/9.3/bin directory. You could use doinst.sh script,
which is copied to
/var/log/script/postgresql-9.3.0*
Future PostgreSQL releases (e.g. 9.4) won't have binaries, but symlinks in
/usr/bin, so this
won't be necessary.

Any feedback on all of this and testing the SlackBuild would be warmly
welcomed.

Best regards,
Adis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20130911/67954bd9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postgresql.tgz
Type: application/x-gzip
Size: 5997 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20130911/67954bd9/attachment.bin>


More information about the SlackBuilds-users mailing list