Search code examples
postgresqlamazon-web-servicespostgisamazon-rdspostgresql-11

postgres upgrade from 10.9 to 11.4 failure (aws rds)


postgres upgrade from 10.9 to 11.4 on aws rds failure with below reason

Database instance is in a state that cannot be upgraded: PreUpgrade checks failed: The instance could not be upgraded because there are one or more databases with an older version of PostGIS installed. Please upgrade all installations of PostGIS and try again.

i have postgis 2.4.4 installed and command

ALTER EXTENSION postgis UPDATE; 

fails with message

NOTICE: version "2.4.4" of extension "postgis" is already installed

and command

ALTER EXTENSION postgis UPDATE TO "2.5.1"

fails with this message

extension "postgis" has no update path from version "2.4.4" to version "2.5.1"


Solution

  • It gives you that error because there is no upgrade from 2.4.4 to 2.5.1. You can only move to 2.5.2 as next step.

    Refer to this page under section "PostgreSQL version 10.x extensions supported on Amazon RDS".

    And similarly if you wanted to go to 3.1.4 from 2.4.4, you must first go to 2.5.2 and then to 3.1.4.

    See image for the versions