The PostgreSQL Global Development Group (PGDG) maintains repositories for various Linux distributions, including Amazon Linux 2, to provide up-to-date versions of PostgreSQL packages.
To install the PostgreSQL 15 client on Amazon Linux 2 using the PostgreSQL Global Development Group (PGDG) repository, follow these steps:

Update your system:

sudo yum update -y


Install the PostgreSQL 15 repository from PGDG:
Download and install the repository RPM for PostgreSQL 15 provided by PGDG.
sudo yum install -y https://download.postgresql.org/pub/repos/yum/15/redhat/rhel-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm


Disable the built-in PostgreSQL module (if it exists):
Disabling the built-in PostgreSQL modules helps prevent any conflicts.
sudo yum -qy module disable postgresql


Install the PostgreSQL 15 client:
Now, install the PostgreSQL 15 client package.
sudo yum install -y postgresql15


Verify the installation:
Check the version of the installed PostgreSQL client to ensure it's installed correctly.
psql --version


Output:
You should see output similar to:
psql (PostgreSQL) 15.x