I ran the upgrade from 9.5 to 10 and it appeared that everything went smoothly. However, when I inspected the database using psql, the databases do not seem to have any tables defined. Any idea what could be wrong?
Here's a transcript:
docker run --rm \
> -v /data:/var/lib/postgresql \
> tianon/postgres-upgrade:9.5-to-10 \
> --link
Unable to find image 'tianon/postgres-upgrade:9.5-to-10' locally
9.5-to-10: Pulling from tianon/postgres-upgrade
723254a2c089: Already exists
39ec0e6c372c: Already exists
ba1542fb91f3: Already exists
c7195e642388: Already exists
95424deca6a2: Already exists
2d7d4b3a4ce2: Already exists
fbde41d4a8cc: Already exists
880120b92add: Already exists
9a217c784089: Already exists
d581543fe8e7: Already exists
e5eff8940bb0: Already exists
462d60a56b09: Already exists
135fa6b9c139: Already exists
e913dd1518e8: Pull complete
8cf5f006816f: Pull complete
628f58081730: Pull complete
0de97691839d: Pull complete
Digest: sha256:087e932c42d377af249604cc34d205a7b7c7dfa7e8e8be623603ec172ee9d10f
Status: Downloaded newer image for tianon/postgres-upgrade:9.5-to-10
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/10/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
Success. You can now start the database server using:
pg_ctl -D /var/lib/postgresql/10/data -l logfile start
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is the install user ok
Checking database connection settings ok
Checking for prepared transactions ok
Checking for reg* data types in user tables ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for invalid "unknown" user columns ok
Checking for roles starting with "pg_" ok
Creating dump of global objects ok
Creating dump of database schemas
csdb
postgres
template1
ok
Checking for presence of required libraries ok
Checking database user is the install user ok
Checking for prepared transactions ok
If pg_upgrade fails after this point, you must re-initdb the
new cluster before continuing.
Performing Upgrade
------------------
Analyzing all rows in the new cluster ok
Freezing all rows in the new cluster ok
Deleting files from new pg_xact ok
Copying old pg_clog to new server ok
Setting next transaction ID and epoch for new cluster ok
Deleting files from new pg_multixact/offsets ok
Copying old pg_multixact/offsets to new server ok
Deleting files from new pg_multixact/members ok
Copying old pg_multixact/members to new server ok
Setting next multixact ID and offset for new cluster ok
Resetting WAL archives ok
Setting frozenxid and minmxid counters in new cluster ok
Restoring global objects in the new cluster ok
Restoring database schemas in the new cluster
csdb
postgres
template1
ok
Adding ".old" suffix to old global/pg_control ok
If you want to start the old cluster, you will need to remove
the ".old" suffix from /var/lib/postgresql/9.5/data/global/pg_control.old.
Because "link" mode was used, the old cluster cannot be safely
started once the new cluster has been started.
Linking user relation files
/var/lib/postgresql/9.5/data/base/32889/2613
/var/lib/postgresql/9.5/data/base/32889/2683
/var/lib/postgresql/9.5/data/base/32889/2995
/var/lib/postgresql/9.5/data/base/32889/2996
/var/lib/postgresql/9.5/data/base/32889/32890
/var/lib/postgresql/9.5/data/base/32889/32893
/var/lib/postgresql/9.5/data/base/32889/32897
/var/lib/postgresql/9.5/data/base/32889/32901
/var/lib/postgresql/9.5/data/base/32889/32903
/var/lib/postgresql/9.5/data/base/32889/32904
/var/lib/postgresql/9.5/data/base/32889/32906
/var/lib/postgresql/9.5/data/base/32889/32910
/var/lib/postgresql/9.5/data/base/32889/32914
/var/lib/postgresql/9.5/data/base/32889/32916
/var/lib/postgresql/9.5/data/base/32889/32917
/var/lib/postgresql/9.5/data/base/32889/32919
/var/lib/postgresql/9.5/data/base/32889/32928
/var/lib/postgresql/9.5/data/base/32889/32932
/var/lib/postgresql/9.5/data/base/32889/32934
/var/lib/postgresql/9.5/data/base/32889/32935
/var/lib/postgresql/9.5/data/base/32889/32944
/var/lib/postgresql/9.5/data/base/32889/32948
/var/lib/postgresql/9.5/data/base/32889/32950
/var/lib/postgresql/9.5/data/base/32889/32957
/var/lib/postgresql/9.5/data/base/32889/32960
/var/lib/postgresql/9.5/data/base/32889/32962
/var/lib/postgresql/9.5/data/base/32889/32963
/var/lib/postgresql/9.5/data/base/32889/32982
/var/lib/postgresql/9.5/data/base/32889/32986
/var/lib/postgresql/9.5/data/base/32889/32988
/var/lib/postgresql/9.5/data/base/32889/32989
/var/lib/postgresql/9.5/data/base/32889/33013
/var/lib/postgresql/9.5/data/base/32889/33017
/var/lib/postgresql/9.5/data/base/32889/33031
/var/lib/postgresql/9.5/data/base/32889/33035
/var/lib/postgresql/9.5/data/base/32889/33037
/var/lib/postgresql/9.5/data/base/32889/33038
/var/lib/postgresql/9.5/data/base/32889/33050
/var/lib/postgresql/9.5/data/base/32889/33063
/var/lib/postgresql/9.5/data/base/12379/2613
/var/lib/postgresql/9.5/data/base/12379/2683
/var/lib/postgresql/9.5/data/base/12379/2995
/var/lib/postgresql/9.5/data/base/12379/2996
/var/lib/postgresql/9.5/data/base/1/2613
/var/lib/postgresql/9.5/data/base/1/2683
/var/lib/postgresql/9.5/data/base/1/2995
/var/lib/postgresql/9.5/data/base/1/2996
ok
Setting next OID for new cluster ok
Sync data directory to disk ok
Creating script to analyze new cluster ok
Creating script to delete old cluster ok
Checking for hash indexes ok
Upgrade Complete
----------------
Optimizer statistics are not transferred by pg_upgrade so,
once you start the new server, consider running:
./analyze_new_cluster.sh
Running this script will delete the old cluster's data files:
./delete_old_cluster.sh
mark@:xxxx/data$ ls
10 9.5 analyze_new_cluster.sh delete_old_cluster.sh
mark@:xxxx/data$ sudo ls 10/data
[sudo] password for mark:
base pg_hba.conf pg_notify pg_stat pg_twophase postgresql.auto.conf
global pg_ident.conf pg_replslot pg_stat_tmp PG_VERSION postgresql.conf
pg_commit_ts pg_logical pg_serial pg_subtrans pg_wal postmaster.opts
pg_dynshmem pg_multixact pg_snapshots pg_tblspc pg_xact
mark:/data$ docker exec -it cs_postgres_1 psql --username=csroot --dbname=csdb
psql (10.1)
Type "help" for help.
csdb=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+------------+------------+-----------------------
csdb | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
postgres | postgres | UTF8 | en_US.utf8 | en_US.utf8 |
template0 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | en_US.utf8 | en_US.utf8 | =c/postgres +
| | | | | postgres=CTc/postgres
(4 rows)
csdb=# \d
Did not find any relations.
Just a followup. I thought if I removed the ".old" suffix from /var/lib/postgresql/9.5/data/global/pg_control.old, I would be able to restart a 9.5 instance, however, all of the data is gone from that too.
I ran the upgrade from 9.5 to 10 and it appeared that everything went smoothly. However, when I inspected the database using psql, the databases do not seem to have any tables defined. Any idea what could be wrong?
Here's a transcript: