Upgrade from Postgres 12.7.R1 to 13.3.R1 stuck

1

We are trying to upgrade our RDS DB from Postgres 12.7.R1 to 13.3.R1 however this is failing:

The instance could not be upgraded from 12.7.R1 to 13.3.R1 because of following reasons. Please take appropriate action on databases that have usages incompatible with requested major engine version upgrade and try again.
- Following usages in database 'staging' need to be corrected before upgrade:
-- The instance could not be upgraded because there are one or more databases with an older version of PostGIS extension or its dependent extensions (address_standardizer, address_standardizer_data_us, postgis_tiger_geocoder, postgis_topology, postgis_raster) installed. Please upgrade all installations of PostGIS and drop its dependent extensions and try again.

We only have PostGIS installed none of these other extensions and it is already running the latest version available:

_List of installed extensions_  
 _Name      | Version |   Schema   |                             Description_                               

---------------------------------------------------------------------------------------------------------+
fuzzystrmatch | 1.0 | public | determine similarities and distance between strings
pg_trgm | 1.3 | public | text similarity measurement and index searching based on trigrams
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
plv8 | 2.3.8 | pg_catalog | PL/JavaScript (v8) trusted procedural language
postgis | 3.0.3 | public | PostGIS geometry, geography, and raster spatial types and functions
tablefunc | 1.0 | public | functions that manipulate whole tables, including crosstab
(6 rows)

We are completely stuck and would be very grateful of any advice on how to proceed.

Many thanks in advance for any help.

1 Answer
0

For anyone else who find this the problem appears to be that the AWS process for moving up to PostGIS 3.x does not quite work as expected, I suspect this is due to PostGIS splitting out raster to a separate extension. I had already run ALTER EXTENSION postgis UPDATE; but this did not sort the problem. ALTER EXTENSION postgis_raster UPDATE; said this was not installed however it was not possible to install this either.

This post helped point me in the right direction: https://stackoverflow.com/questions/42634626/postgresql-upgrade-on-amazon-rds-blocked-by-postgis-version

When running SELECT postgis_full_version(); I got:

POSTGIS="3.0.3 6660953" [EXTENSION] PGSQL="120" GEOS="3.8.0-CAPI-1.13.1 " PROJ="Rel. 5.2.0, September 15th, 2018" GDAL="GDAL 2.4.4, released 2020/01/08" LIBXML="2.9.1" LIBJSON="0.13.1" LIBPROTOBUF="1.3.2" WAGYU="0.4.3 (Internal)" RASTER (raster lib from "2.5.2 r17328" need upgrade) [UNPACKAGED!] (raster procs from "2.5.2 r17328" need upgrade)

Running SELECT postgis_extensions_upgrade(); seems to have resolved the issue. I ran ALTER EXTENSION postgis UPDATE; to be on the safe side.

Just kicked off the upgrade and it's now running well.

I hope this helps anyone who has similar issues.

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions