In the process of upgrading my PostgreSQL from version 9.2.4 to 9.3.1 (via homebrew on OS X) I came across an odd problem. These are the steps I took so far
initdb
on the new databasepg_upgrade
pg_upgrade
performs the necessary checks, creates dumps of the old cluster, but when importing into the new cluster I get the following error:
> ./pg_upgrade -b /usr/local/Cellar/postgresql/9.2.4/bin/ -B /usr/local/Cellar/postgresql/9.3.1/bin -d /usr/local/var/postgres/ -D /usr/local/var/postgres9.3.1 -u postgres
Performing Consistency Checks
-----------------------------
Checking cluster versions ok
Checking database user is a superuser ok
Checking for prepared transactions ok
Checking for reg* system OID user data types ok
Checking for contrib/isn with bigint-passing mismatch 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
Failure, exiting
It appears as though PostgreSQL 9.3.1 tries to use PostGIS 2.0, which is not compatible
Could not load library "$libdir/postgis-2.0"
ERROR: could not access file "$libdir/postgis-2.0": No such file or directory
Could not load library "$libdir/rtpostgis-2.0"
ERROR: could not access file "$libdir/rtpostgis-2.0": No such file or directory
Has anyone run into the same problem?
You can do this from within pgAdmin or via psql -U [superuser] [database] from a command line. Alternately for the command adverse; as a superuser; from within pgAdmin right click on your database's Extensions and select New Extension. Then in the drop down associated with Name select the postgis* extensions needed.
However, Postgres. app has been adding support for other extensions, and now comes with support for PostGIS, PLV8 and MVT already built in. If you want PgRouting, you can use Homebrew to install the dependencies it needs, and build it from source.
PostGIS 3.2. 3 came out Aug 18, 2022.
I recently ran into this problem and re-installing postgis worked for me. That is, go to the folder in which you tar'ed the source file (if you installed postgis from source) and re-run:
./configure
make
sudo make install
If you've installed the latest version of postgresql, postgis should install into the new postgresql's extension folder:
/usr/share/postgresql/x.x/extension/
To check, run:
sudo su -l postgres
psql template1 -p 5433
SELECT name, default_version,installed_version
FROM pg_available_extensions WHERE name LIKE 'postgis%' ;
If postgis has successfully installed, you should see the version number indicated in the "installed" column. Now when you try running the pg_upgrade command, everything should work fine.
Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With