2

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"

1
  • pls select my answer if it helped. Thanks. Commented Apr 8, 2022 at 6:13

2 Answers 2

4

In order to upgrade to version 2.5.* you need to run the following command

ALTER EXTENSION postgis UPDATE TO "2.5.2";

Sign up to request clarification or add additional context in comments.

2 Comments

As a clarification, this is because AWS RDS supports specific versions of PostgreSQL extensions. In this case, the PostGIS version that is supported for v10 is 2.5.2. This is in this table in the AWS documentation: docs.aws.amazon.com/AmazonRDS/latest/UserGuide/…
You cannot run this statement on his db as versions over 2.4.4 are not supported.
1

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

1 Comment

@Vinesh, pls select my answer if it helped.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.