| When you face any error setting up a connection with your Postgresql server like below, you will need to find a way to upgrade your libpq $ psql -h localhost -p 35432 -U postgres -d ucms -c "SELECT version();"
psql: SCRAM authentication requires libpq version 10 or above
Actually the operating system I use is CentOS 7 - this is a bit outdated operating system, so the associated libraries are also outdated. Here are the scripts you can use to upgrade your libpq: Install libpq from the official PostgreSQL (PGDG) repo so you can choose the version: Install repo: sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
Install the desired major version of the client libs (examples): # PostgreSQL 12
sudo yum install -y postgresql12-libs
# PostgreSQL 13
sudo yum install -y postgresql13-libs
# PostgreSQL 14
sudo yum install -y postgresql14-libs
# PostgreSQL 15
sudo yum install -y postgresql15-libs
If you need headers for building (e.g., libpq-fe.h): sudo yum install -y postgresql14-devel # pick the same major version you installed
Verify: ldconfig -p | grep libpq
rpm -qa | grep postgresql.*libs
Notes - The CentOS 7 base repo postgresql-libs is very old (9.2). Use PGDG to get newer versions.
- To pin a specific minor version: sudo yum install -y postgresql14-libs-14.14-1PGDG.rhel7 (adjust as needed).
- If base mirrors fail due to CentOS 7 EOL, enable the CentOS Vault repos or rely solely on PGDG for these packages.
|