I'm trying to upgrade a 9.5 server to 9.6, and pg_upgrade gives me the following error:
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* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch ok
Checking for roles starting with 'pg_' ok
Creating dump of global objects ok
Creating dump of database schemas
ok
Checking for presence of required libraries fatal
Your installation references loadable libraries that are missing from the
new installation. You can add these libraries to the new installation,
or remove the functions using them from the old installation. A list of
problem libraries is in the file:
loadable_libraries.txt
Which contains:
could not load library "$libdir/rtpostgis-2.2":
ERROR: could not access file "$libdir/rtpostgis-2.2": No such file or directory
When I start the server and run "CREATE EXTENSION postgis" and then stop the server, pg_upgrade then gives me an error about a non-empty DB:
New cluster database "postgres" is not empty
So, I'm caught in a catch-22 - I can't upgrade without installing the extension, but once I do it considers the database not empty.
Any tips how to fix this?