We use machine learning technology to do auto-translation. Click "English" on top navigation bar to check Chinese version.
Upgrade Amazon Aurora PostgreSQL and Amazon RDS for PostgreSQL version 10
-
Announcement: Amazon Aurora PostgreSQL 10.x end of life is January 31, 2023 -
Announcement: Amazon RDS for PostgreSQL 10.x end of life is April 17, 2023
Unlike minor version upgrades, which are backward-compatible with existing applications, major version upgrades can contain database changes that aren’t backward-compatible with existing applications. Prior to initiating the upgrade, we recommend you carefully plan and test major version upgrades. The benefits of the higher major versions include new features, improved performance and a higher security posture.
In this post, we cover the following topics:
- Aurora PostgreSQL-compatible and Amazon RDS for PostgreSQL end of life timeline
- In-place upgrade compared to out-of-place upgrade approaches
Aurora PostgreSQL and Amazon RDS for PostgreSQL end of life timeline
The
The community PostgreSQL 10 end of life was set for November 10, 2022. The Aurora and RDS for PostgreSQL end of life dates are derived from the community end of life dates. Below are the important dates for RDS and Aurora PostgreSQL 10.x end of life:
- Starting January 31, 2023 00:00:01 UTC, Amazon Web Services may upgrade your Aurora PostgreSQL 10.x databases to a newer major version.
- Starting April 17, 2023 00:00:01 UTC, Amazon Web Services may upgrade your RDS for PostgreSQL 10.x databases to PostgreSQL 14 major version during a scheduled maintenance window. Any remaining RDS for PostgreSQL 10.x databases will be upgraded to PostgreSQL 14 starting July 18, 2023 00:00:01 UTC regardless of the maintenance window.
Choose a target engine version for upgrade
We recommend upgrading all instances to PostgreSQL 14 or newer. However, selection of the target major version may depend on your application and business needs. Planning and executing the upgrade on your schedule allows you to determine the version that best meets your needs.
We recommend that you first upgrade to minor version 10.21 or greater, apply any pending operating system maintenance, and then upgrade directly to PostgreSQL 14 or greater so that you can skip intermediate major versions. Skipping major versions helps save database downtime and upgrade efforts. Alternatively, if your application is not ready for PostgreSQL 14, you may consider other major versions such as PostgreSQL 12 and PostgreSQL 13 depending on your business and application needs.
You can use the
The following table summarizes the
Current Source Version | Newest Upgrade Target | Other Available Upgrade Targets | ||||||||
10.21 | 14.4 | 14.3 | 13.7 | 12.11 | 11.17 | 11.16 | ||||
10.20 | 13.6 | 12.10 | 11.17 | 11.16 | 11.15 | 10.21 | ||||
10.19 | 11.17 | 11.16 | 11.15 | 11.14 | 10.21 | 10.20 | ||||
10.18 | 13.4 | 12.8 | 11.17 | 11.16 | 11.15 | 11.14 | 11.13 | 10.21 | 10.20 | 10.19 |
10.17 | 11.17 | 11.16 | 11.15 | 11.14 | 11.13 | 11.12 | 10.21 | 10.20 | 10.19 | 10.18 |
You can use the Amazon Web Services CLI as follows to find the target Amazon RDS for PostgreSQL versions:
The following table summarizes the upgrade targets for Amazon RDS for PostgreSQL.
Current Source Version | Newest Upgrade Target | Other Available Upgrade Targets | ||||||||||
10.21 | 14.4 | 14.3 | 13.7 | 12.11 | 11.17 | 11.16 | 10.22 | |||||
10.20 | 14.2 | 13.6 | 12.10 | 11.17 | 11.16 | 11.15 | 10.22 | 10.21 | ||||
10.19 | 14.1 | 13.5 | 12.9 | 11.17 | 11.16 | 11.15 | 11.14 | 10.22 | 10.21 | 10.20 | ||
10.18 | 13.4 | 12.8 | 11.17 | 11.16 | 11.15 | 11.14 | 11.13 | 10.22 | 10.21 | 10.20 | 10.19 | |
10.17 | 13.3 | 12.7 | 11.17 | 11.16 | 11.15 | 11.14 | 11.13 | 11.12 | 10.21 | 10.20 | 10.19 | 10.18 |
Features available in major versions
The following table lists some of the major features across all the versions.
Version | Major Features |
14 |
|
13 |
|
12 |
|
There are two options to perform major version upgrade: in-place and out-of-place. In-place option upgrades the database on the existing instance or cluster. Out-of-place involves external database instance or cluster to accomplish upgrade.
In-place upgrade
Both Aurora PostgreSQL and Amazon RDS for PostgreSQL support in-place automated upgrades, which use the
In major version upgrades, Amazon RDS and Aurora completes the following steps:
- Take a pre-upgrade snapshot. You can use this snapshot for rollbacks.
- Shut down the instance and prepare it for the upgrade.
- Use the pg_upgrade utility to run the upgrade job on the instance.
- Take a post-upgrade snapshot. Networking is now reconfigured on the instance.
Downtime required for an in-place upgrade primarily depends on the size and number of the objects in the database. This can be determined by restoring a snapshot and upgrading it. Choose this option if your business can afford the downtime with the fewest administration tasks.
To learn more about major version upgrades, see
Out-of-place upgrade
The following are the high-level steps for an out-of-place upgrade. Actual steps needed may vary depending on your environment and the type of synchronization method you choose.
- Create a copy of the production database instance by using
RDS snapshots orAurora clones . - Upgrade the new instance to higher PostgreSQL version.
- Configure continuous replication between the source and new upgraded instance by using one of the methods as discussed below.
- During the cutoff window, after both source and target database instances are in sync, point the application to the target database instance.
An out-of-place upgrade is more complex than an in-place upgrade as it requires manual steps and monitoring.
In the following sections, we discuss three options to perform an out-of-place upgrade.
Option A: Logical replication
Aurora PostgreSQL and Amazon RDS for PostgreSQL version 10 and higher support logical replication using pglogical
. The process typically starts with taking a snapshot of the data on the publisher database and copying that to the subscriber. Then the changes on the publisher are sent to the subscriber as they occur in real time. This
This process has the following advantages:
- Downtime during the upgrade can be reduced
- Continuous replication
However, it has the following disadvantages:
- Takes several steps to configure replication
- Initial synchronization on large databases may take more time
- Can’t replicate large objects, sequences, DDL, and so on
Option B: Amazon Web Services DMS with CDC
Aurora PostgreSQL and Amazon RDS for PostgreSQL version 10 and higher support
This option has the following advantages:
- Downtime during the upgrade can be reduced
- Continuous replication
However, it has the following disadvantages:
- Amazon Web Services DMS doesn’t support certain data types, like timestamp with time zone
- You have to pay for Amazon Web Services DMS for the duration it takes this upgrade project to complete
Option C: Bucardo (Amazon RDS for PostgreSQL and Aurora PostgreSQL)
For instructions to configure Bucardo, see
This process has the following advantages:
- Secondary databases can be pre-warmed for quick setup
- Reduces downtime for upgrades
- Continuous replication
However, it has the following disadvantages:
- Takes several steps to configure
- Can’t handle large objects and DDL
- Can’t incrementally replicate tables without a unique key (it can full copy them)
- Requires an EC2 instance to host the tool
In-place upgrade compared to out-of-place upgrade approaches
Choosing one option over the other primarily depends on trading off between downtime and complexity. You need to determine how much downtime your business can afford and the complexity of upgrade you are willing to take on. An in-place upgrade can be performed from the RDS Console or CLI and requires downtime. In contrast, an out-of-place upgrade reduces the downtime because the upgrade happens on a copy of the database, but it takes several steps to configure continuous replication with the new database instance until cutover happens.
Summary
Now is the time to upgrade all your PostgreSQL 10 instances. You can initiate upgrades at any time from now to before the end-of-life date (January 31, 2023, for Aurora PostgreSQL and April 17, 2023, for Amazon RDS for PostgreSQL). We recommend planning and testing these major version upgrades and performing them according to the needs of your application.
Depending on the approaches taken, (in-place or out-of-place upgrade), you should perform a dry run using the selected approach on a copy of the production database instance to estimate the time needed and prepare for the final production upgrade.
If you need assistance or have feedback, reach out to your usual Amazon Web Services support contacts, or post a message in the
About the Authors
Vivek Singh is a Database Specialist with Amazon Web Services focusing on Amazon RDS/Aurora PostgreSQL engines. He works with enterprise customers providing technical assistance on PostgreSQL operational performance and sharing database best practices.
Garry Knox is a Technical Account Manager for Amazon Web Services Enterprise Support. He works with external customers on a variety of projects, helping them improve the value of their solutions when using Amazon Web Services.
The mentioned AWS GenAI Services service names relating to generative AI are only available or previewed in the Global Regions. Amazon Web Services China promotes AWS GenAI Services relating to generative AI solely for China-to-global business purposes and/or advanced technology introduction.