postgres 从 10.9 升级到 11.4 失败 (aws rds)

postgres upgrade from 10.9 to 11.4 failure (aws rds)

在 aws rds 失败时将 postgres 从 10.9 升级到 11.4,原因如下

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.

我安装了 postgis 2.4.4 和命令

ALTER EXTENSION postgis UPDATE; 

失败并显示消息

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

和命令

ALTER EXTENSION postgis UPDATE TO "2.5.1"

此消息失败

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

为了升级到版本 2.5.* 您需要运行以下命令

ALTER EXTENSION postgis UPDATE TO "2.5.2";

它给你这个错误是因为没有从 2.4.4 升级到 2.5.1。下一步只能移动到 2.5.2

请参阅“Amazon RDS 支持的 PostgreSQL 版本 10.x 扩展”部分下的 page

同样,如果您想从 2.4.4 转到 3.1.4,您必须先 到 2.5.2 然后到 3.1.4.