Discussion:
How to use pg_upgrade for beta versions
René Leonhardt
2014-07-26 14:56:14 UTC
Permalink
It has been recommended to pg_upgrade from 9.4 beta 1 to 2:
http://www.postgresql.org/message-id/***@postgresql.org

How do I that on the Ubuntu 14.04.1 PPA?
http://www.postgresql.org/download/linux/ubuntu/

Upgrading directly is not possible:
$ sudo apt-get dist-upgrade
Preparing to unpack .../postgresql-9.4_9.4~beta2-1.pgdg14.04+1_amd64.deb ...
ERROR: The database format changed between beta 1 and 2. Please dump
your 9.4 clusters first and remove them before upgrading the package.
dpkg: error processing archive
/var/cache/apt/archives/postgresql-9.4_9.4~beta2-1.pgdg14.04+1_amd64.deb
(--unpack):
subprocess new pre-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/postgresql-9.4_9.4~beta2-1.pgdg14.04+1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Executing apt-get install -f afterwards shows the same error.


At least I am able to upgrade/install postgresql-contrib-9.4
(9.4~beta2-1.pgdg14.04+1), which gives me following tools:
$ ls -1 /usr/lib/postgresql/9.4/bin/
clusterdb
createdb
createlang
createuser
dropdb
droplang
dropuser
oid2name
pg_archivecleanup
pg_basebackup
pgbench
pg_dump
pg_dumpall
pg_isready
pg_receivexlog
pg_recvlogical
pg_restore
pg_standby
pg_test_fsync
pg_test_timing
psql
reindexdb
vacuumdb
vacuumlo


/etc/postgresql/9.4/main/postgresql.conf data_directory still points to
the Beta 1 cluster in /var/lib/postgresql/9.4/main
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Adrian Klaver
2014-07-26 18:38:16 UTC
Permalink
It is recommended in the spirit of testing the changes to the pg_upgrade
code, so it is a soft recommendation. In any event I do not remember
pg_upgrade being integrated into the apt-get process. This is something
you will have to do separately.
Post by René Leonhardt
How do I that on the Ubuntu 14.04.1 PPA?
http://www.postgresql.org/download/linux/ubuntu/
Are you actually using the PPA, I thought that only went up to 12.04?

Or are you using the Postgres repo?:

http://apt.postgresql.org/pub/repos/apt/
Post by René Leonhardt
$ sudo apt-get dist-upgrade
Not sure you want to do a dist-upgrade if you want to test pg_upgrade,
as it will want to replace the version of Postgres and lead to the ERROR
notice below.
Post by René Leonhardt
Preparing to unpack .../postgresql-9.4_9.4~beta2-1.pgdg14.04+1_amd64.deb ...
ERROR: The database format changed between beta 1 and 2. Please dump
your 9.4 clusters first and remove them before upgrading the package.
dpkg: error processing archive
/var/cache/apt/archives/postgresql-9.4_9.4~beta2-1.pgdg14.04+1_amd64.deb
subprocess new pre-installation script returned error exit status 1
/var/cache/apt/archives/postgresql-9.4_9.4~beta2-1.pgdg14.04+1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Executing apt-get install -f afterwards shows the same error.
It would seem you would want to do a straight install of 9.4beta2 where
the package manager sets up a separate instance for it and then use
pg_upgrade to move the data from beta1 to beta2. Otherwise you could go
the dump/restore route.
--
Adrian Klaver
***@aklaver.com
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Bruce Momjian
2014-07-27 01:09:56 UTC
Permalink
Post by Adrian Klaver
It is recommended in the spirit of testing the changes to the
pg_upgrade code, so it is a soft recommendation. In any event I do
not remember pg_upgrade being integrated into the apt-get process.
This is something you will have to do separately.
Yeah, it seems the packagers should be using pg_upgrade for this, as I
think they already use it for major release upgrades. Adrian is right,
though, that you might just need to run pg_upgrade manually.
--
Bruce Momjian <***@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Craig Ringer
2014-07-27 12:14:08 UTC
Permalink
Post by Adrian Klaver
It is recommended in the spirit of testing the changes to the pg_upgrade
code, so it is a soft recommendation. In any event I do not remember
pg_upgrade being integrated into the apt-get process. This is something
you will have to do separately.
pg_upgradecluster is part of pg_wrapper, and should handle it.

I don't know if it handles beta upgrades though.
--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
--
Sent via pgsql-general mailing list (pgsql-***@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Loading...