🍅
bl.cdm
  • 🙋Hey there! I'm Steven 🚀
  • 🐛Using Cloudflare Access Service Tokens with a Single JSON Header
  • 📎How to remove your old iCloud email (not alias)
  • 📚YouTube subscriptions export / import
  • 🔍Cloud Run Deployment Preview Github Actions workflows
  • 🊞Static website deployment preview with S3 and CloudFront
  • 🐋Allow Docker Remote API access over Tailscale network
  • 📟I built a cheapo arm server using an old TV box
  • ðŸŠĶI built a cheapo NAS
  • ðŸĪ–How I monitor my Windows machines using Grafana
  • 🐘Connect to PostgreSQL 15 database on Amazon Linux 1
  • ðŸ”ŪCircle CI - AWS Assume Role Orb
  • ðŸģDeploy JupyterHub with GitLab Authenticator on Docker
Powered by GitBook
On this page
  • Problem
  • Solution

Was this helpful?

Connect to PostgreSQL 15 database on Amazon Linux 1

For those who stuck with AMIv1, and their application is connecting to a PostgreSQL 15 database.

PreviousHow I monitor my Windows machines using GrafanaNextCircle CI - AWS Assume Role Orb

Last updated 24 days ago

Was this helpful?

Problem

Current AMIv1 only contains up to PostgreSQL version 9.6 as per:

yum search postgresql

...
postgresql95.x86_64 : PostgreSQL client programs
postgresql95-contrib.x86_64 : Extension modules distributed with PostgreSQL
postgresql95-devel.x86_64 : PostgreSQL development header files and libraries
...
postgresql96-server.x86_64 : The programs needed to create and run a PostgreSQL server
postgresql96-static.x86_64 : Statically linked PostgreSQL libraries
postgresql96-test.x86_64 : The test suite distributed with PostgreSQL
...

thus for application required connection to PostgreSQL 15 would fail miserably with this error:

CRAM authentication requires libpq version 10 or above (PG::ConnectionBad)

EDIT: The repo is accessible if appending index.html. However, I still unable to find any pre-built binary for it. PostgreSQL version before 12 is no longer available on all PostgreSQL repositories. Yet, the archive yum repository is currently in-accessiable:

https://yum-archive.postgresql.org/

Solution

The only way right now is to install postgresql 12 and pray that nothing will break (yes, jumping 3 major version is something need to be carefully evaluated)

sudo yum install -y https://download.postgresql.org/pub/repos/yum/12/redhat/rhel-6-x86_64/postgresql12-libs-12.9-1PGDG.rhel6.x86_64.rpm
sudo yum install -y https://download.postgresql.org/pub/repos/yum/12/redhat/rhel-6-x86_64/postgresql12-12.9-1PGDG.rhel6.x86_64.rpm
sudo yum install -y https://download.postgresql.org/pub/repos/yum/12/redhat/rhel-6-x86_64/postgresql12-devel-12.9-1PGDG.rhel6.x86_64.rpm
🐘
https://aws.amazon.com/amazon-linux-ami/2018-03-packages/
no hope