How can a script identify valid PostgreSQL upgrade paths?

0

I'm trying to write a script to upgrade an RDS PostgreSQL instance from version x to version y. Since RDS only supports direct upgrades to certain versions, the script uses multiple "hops" to upgrade, using the fewest number of upgrade actions possible. Unfortunately, I've not been able to come up with a reliable way to identify those direct upgrade paths.

The documentation for upgrading PostgreSQL database versions (Upgrading the PostgreSQL DB engine for Amazon RDS) includes a table show the direct upgrade versions supported for every supported (and deprecated) version. For example, an instance running PostgreSQL 12.14 can be directly upgraded to versions

15.2 14.7 13.14 13.13 13.12 13.11 13.10 12.18 12.17 12.16 12.15

if you upgrade an instance using the RDS console, the DB engine version dropdown shows the same list, likewise the modify-db-command fails if passed an --engine-version value other than these version.

The documentation claims the upgrade table is a summary of the results from running the following CLI command:

aws rds describe-db-engine-versions --engine postgres --engine-version your-version --query "DBEngineVersions[*].ValidUpgradeTarget[*].{EngineVersion:EngineVersion}" --output text

However, when I run this query directly, it lists more options than are allowed by the console dropdown (or equivalent modify-db-instance CLI command):

16.1 15.5 15.4 15.3 15.2 14.10 14.9 14.8 14.7 13.13 13.12 13.11 13.10 12.17 12.16 12.15

I'd hoped to be able to use this query as the basis for this script, but due to this discrepancy I can't. Is there some additional criteria being used to generate the table that I'm not seeing? Otherwise I may be reduced to scraping the HTML page :-(

Appreciate any insight y'all can provide.

asked a month ago131 views
No Answers

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