Installing Postgres Client on Amazon Linux

February 11, 2019

I needed to install a postgres client onto Amazon Linux so that I could access my RDS database with it temporarily.


To install:

[ec2-user ~]$ sudo yum install -y

[ec2-user ~]$ sudo sed -i "s/rhel-\$releasever-\$basearch/rhel-latest-x86_64/g" "/etc/yum.repos.d/pgdg-10-redhat.repo"

[ec2-user ~]$ sudo yum install -y postgresql10

[ec2-user ~]$ psql --version

psql (PostgreSQL) 10.6


You can connect to the RDS instance (provided you're in the right security group) using:

$ psql -h -U adminuser -d databasename