'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 1:[1]

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

ALTER EXTENSION postgis UPDATE TO "2.5.2";

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 myusuf3