Upgrade the engine version

Overview

You upgrade rdspg-lab-db in two steps:

Step From To What RDS does
Minor version upgrade 17.9 17.11 Takes a snapshot, upgrades the engine, and restarts the database
Major version upgrade 17.11 18.6 Takes a pre-upgrade snapshot, runs pg_upgrade, switches to the default.postgres18 parameter group, and restarts the database

During each upgrade the database is unavailable for a few minutes.

If the DB instance has read replicas, upgrade them before the source instance for a minor version upgrade. For a major version upgrade, RDS upgrades the in-Region read replicas together with the source instance.

Upgrade the minor version (17.9 → 17.11)

  1. Choose rdspg-lab-db, then choose Modify (as in step 2.1). On the Modify DB instance: rdspg-lab-db page, in Settings:

    • (1) Open the DB engine version list. It shows only the versions that 17.9 can upgrade to.
    • (2) Choose 17.11.

    DB engine version

  2. Scroll down to Maintenance:

    • (1) Select Enable auto minor version upgrade, so that RDS installs future minor versions of PostgreSQL 18 for you.
    • (2) Keep the DB instance maintenance window unchanged.

    Maintenance

  3. Choose Continue. On the summary page:

    • (1) Check the changes: Engine version 17.9 → 17.11, Auto minor version upgrade No → Yes.
    • (2) Choose Apply immediately.
    • (3) Choose Modify DB instance.

    Summary of modifications

With Apply during the next scheduled maintenance window, RDS waits until the maintenance window to apply the change. In this workshop you apply it immediately so you can see the result.

  1. The Status of rdspg-lab-db changes to Backing-up, then Upgrading.

    Upgrading

  2. After about 10 minutes, the Status returns to Available. Open the Logs & events tab:

    • (1) In Recent events, the event Database instance engine minor version upgrade complete. Previous version: 17.9.R2. New version: 17.11.R1. confirms the upgrade.

    Minor version upgrade event

Upgrade the major version (17.11 → 18.6)

  1. Choose Modify again. In Settings:

    • (1) DB engine version: 18.6. From 17.11, the only major version target is 18.6.

    DB engine version 18.6

  2. Scroll down to Additional configuration > Database options:

    • (1) DB parameter group has changed to default.postgres18. Each major version needs a parameter group of its own family.

    DB parameter group

If you use a custom parameter group, create a copy for the new family (for example postgres18) and choose it here. You work with custom parameter groups in chapter 6.

  1. Choose Continue:

    • (1) Read the warning: a major version upgrade cannot be reverted, and the database is unavailable for a few minutes.

    Upgrade warning

  2. On the same page:

    • (1) Check the changes: Engine version 17.11 → 18.6, DB parameter group default.postgres17 → default.postgres18.
    • (2) Choose Apply immediately.
    • (3) Choose Modify DB instance.

    Summary of the major version upgrade

  3. The Status changes to Upgrading. A major version upgrade takes about 15 to 20 minutes.

    Major version upgrading

Before a major version upgrade, RDS runs a pre-check and automatically takes a snapshot named rds:preupgrade-rdspg-lab-db-17-11-to-18-6-.... If the upgrade fails, you can restore the database from this snapshot.

(Optional) AWS CLI

Upgrade the engine version with the AWS CLI