Updated on 2022-08-16 GMT+08:00

How Can I Install the PostgreSQL Client?

PostgreSQL provides client installation packages and the required dynamic shared library packages for different OSs on its official website.

Ensure that the database client matches the DB engine version of your RDS PostgreSQL DB instances.

This following uses PostgreSQL 9.5 in Red Hat Linux 6 as an example to describe how to obtain the required installation package and complete the installation.

Procedure

  1. Obtain the PostgreSQL client installation package.

    Find the link to the required version on the download page. postgresql95 is used as an example in the following figure.

    Figure 1 Downloading the PostgreSQL client installation package

  2. Obtain the dynamic shared library package required for the PostgreSQL client.

    Find the link to the required version on the download page. postgresql95-libs is used as an example in the following figure.

    Figure 2 Downloading the dynamic shared library package

  3. Upload the installation and dynamic shared library packages to the ECS.

    1. When you create an ECS, select an OS, such as Red Hat 6.6, and bind an EIP to it.
    2. Use a remote connection tool to connect to the ECS through the bound EIP and upload the installation package and dynamic dependency package to the ECS.

  4. Run the following command to install the PostgreSQL client:

    sudo rpm -ivh postgresql95-9.5.7-1PGDG.rhel6.x86_64.rpm postgresql95-libs-9.5.7-1PGDG.rhel6.x86_64.rpm
    • If there are any conflicts during the installation, add the replacefiles parameter to the command and try to install the client again. Example:
      rpm -ivh --replacefiles postgresql95-9.5.7-1PGDG.rhel6.x86_64.rpm postgresql95-libs-9.5.7-1PGDG.rhel6.x86_64.rpm
    • If a message is displayed prompting you to install a dependency package, you can add the nodeps parameter to the command and install the client again. Example:
      rpm -ivh --nodeps postgresql95-9.5.7-1PGDG.rhel6.x86_64.rpm postgresql95-libs-9.5.7-1PGDG.rhel6.x86_64.rpm