RDS PostgreSQL Lifecycle

Install

CloudFormation

For example steps to install RDS PostgreSQL as part of a CloudFormation Stack, see the Jira Service Desk AWS installation documentation.

PostgreSQL Client on EC2

PostgreSQL 11

Install...

sudo amazon-linux-extras enable postgresql11

sudo yum clean metadata

sudo yum install postgresql

If amazon-linux-extras is not found...

rpm -qa |grep -i amazon-linux-extras
sudo yum install -y amazon-linux-extras

Deinstall...

sudo yum remove postgresql

sudo amazon-linux-extras disable postgresql11

sudo yum clean metadata

PostgreSQL 12

Install...

sudo amazon-linux-extras enable postgresql12

sudo yum clean metadata

sudo yum install postgresql

Troubleshooting

psql -h mypostgresqldb.eu-west-2.rds.amazonaws.com -U postgres -W -d postgres


psql (11.16, server 12.11)WARNING: psql major version 11, server major version 12.         Some psql features might not work.SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)Type "help" for help.
To resolve this issue... remove postgresql11 and install postgresql12

psql -h mypostgresqldb.eu-west-2.rds.amazonaws.com -U postgres -W -d postgres


psql (12.11)SSL connection (protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, compression: off)psql: relocation error: psql: symbol PQgssEncInUse, version RHPG_10 not defined in file libpq.so.5 with link time reference
To resolve this issue...yum remove libpq.x86_64Then reinstall your target postgreSQL version

Patch

Minor updates are applied to RDS PostgreSQL automatically.

Upgrade

For example steps to upgrade RDS PostgreSQL between major versions in a CloudFormation Stack see the Jira Service Desk on AWS Stack Migration documentation.

Bibliography