Notorious 'SCRAM authentication requires libpq version 10'- where do I need to upgrade libpq?

So I have AWS Aurora database recognized as Postgres 14.8;
I also have AWS virtual linux machine where I run R server 4.02
This R server runs my Shiny-based application that connects to AWS Postgres and gives users GUI access to some tables.
I created a new role in Postgres and when trying to run my Shiny application under that role, I got that error message -"SCRAM authentication requires libpq version 10"
As I understand this is what happened:
For development I was using roles created long ago and their passwords were encrypted with md5; but when I created a new role, its password was encrypted under SCRAM. Which is not supported by current libpq library.

Please explain me in simple words: WHERE is this library?
Is it on AWS linux machine (image) where our Aurora Postgres runs,
or
is it on that AWS machine where I run R server?
I do have access to R server and I searched for libpq packages there, found nothing installed.
I ran sudo yum list installed | grep libpq, nothing returned.
So is that library installed on linux server where our Postgres lives?

Hello @Stan_Chcgo,

the issue is 100 % on your shiny / R server.

I am suspecting that your R server runs under Amazon Linux 2 or a linux distribution compatble with RHEL 7/CentOS 7. Those distributions only ship with postgres clients (libpq) in version 9 - as the error message says you need at least libpq version 10. RHEL 7 only ships with version 9 so we need to use a third-party repository to install the updated libpq. Fortunately postgresql.org itself offers such a repository for all major linux distros.

You can install one of the repo files from Repo RPMs - PostgreSQL YUM Repository or run (all commands below for CentOS 7 - compatible with Amazon Linux 2)

Please make sure you understand what linux distribution are running before attempting to run the below commands !

yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install postgresql14-libs

Once you followed those steps, you should be able to contact your Aurora DB with ease. Let me know if you're still stuck.

PS: The reason why yum list installed | grep libpq did not return anything is because the package that provides libpq is named postgresql-libs - you can find out package named by running yum whatprovides libpq.so.* which will return you all RPMs that contain the shard librarylibpq.so.*.

Thank you for response, it totally makes sense!
When I tried to run
sudo yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

I got this:

--> Processing Dependency: /etc/redhat-release for package: pgdg-redhat-repo-42.0-38PGDG.noarch
--> Finished Dependency Resolution
Error: Package: pgdg-redhat-repo-42.0-38PGDG.noarch (/pgdg-redhat-repo-latest.noarch)
           Requires: /etc/redhat-release
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

So installation failed.
I tried to run it with --skip-broken and also ran rpm -Va --nofiles --nodigest, but with no success.

Can you please give an advice what should I do to get it installed?

Can you please post the output of cat /etc/os-release here ? We need to find out which linux distro you are running...

$ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL=https://amazonlinux.com/
SUPPORT_END="2025-06-30"

also
cat /etc/system-release
returns
Amazon Linux release 2 (Karoo)

Hey, it looks like I managed to google correct solution:

just
sudo amazon-linux-extras install postgresql14

And restart R after that

1 Like

wow - that is even more elegant than my next solution with messing around with yum repositories - the postgresql.org repos are not compatible with Amazon linux at all !

Thanks for sharing - this will be valuable for quite a few more users I hope.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.