It appears you have an 8.4 database that isn't managed by pg_wrapper
, and have installed 9.2 from Ubuntu packages and allowed it to create a pg_wrapper
managed cluster in the default location, which isn't where you want the DB.
pg_upgradecluster
from pg_wrapper
isn't suitable for this, since you hand-initdb'd the old cluster.
If the 9.2 cluster doesn't have any data of value in it yet, drop it, destroying all its data:
pg_dropcluster 9.2 main
Then re-create it in the desired location. Assuming your mounted HD's root is /mydata
, you'd:
pg_createcluster -d /mydata/pgdata_9.2_main 9.2 main
Now dump the old database and load it into the new one. Start both 8.4 and 9.1 on different ports; I'll assume 8.4 is on 5432 (default) and 9.2 is on 5433. Something like this should copy the dump from one directly into the other. Make sure you use the 9.1 versions of pg_dumpall
and psql
:
sudo -u postgres pg_dumpall -p 5432 | sudo -u postgres psql -p 5433
... but personally I'd do a pg_dumpall --globals-only
using the 9.2 pg_dumpall
against the 8.4 DB, followed by individual pg_dump
s of each database in the old cluster (again using the 9.2 pg_dump
). I'd then restore the globals dump followed by each individual dump into the new cluster.
Alternately, you can drop the pg_wrapper
managed 9.2 cluster, not re-create it, and follow the instructions for pg_upgrade
to do a binary upgrade from the 8.4 to the 9.2 DB. This will create a DB that is not managed by pg_wrapper
. You can either convert it to be managed by pg_wrapper
by moving and symlinking postgresql.conf
and pg_hba.conf
, or you can just manage it like you did 8.4, using your own init scripts.
But that is 9.1. - Is pgadmin connected to the wrong postgresql?
Yes.
It appears that you're connected to your 9.1 server, suggesting that 9.1 is still running.
Do pg_lsclusters
to see what PostgreSQL installs you have and their status.
Each runs on a different port. If you want to connect to 9.3 you need to check what port it runs on and connect PgAdmin to that port.
Best Answer
After further investigation, to specify the default initdb arguments used in pg_createcluster, the below was added in /etc/postgresql-common/createcluster.conf:
Then pg_createcluster was run as normal and show data_checksums displays: