You can connect to an RDS instance through the PostgreSQL client. This document introduces the connection procedure by taking the pgAdmin 4 client as an example.

Background information

RDS for PostgreSQL is fully compatible with PostgreSQL, so you can connect to RDS in the way you connect to an on-premises PostgreSQL database. This document takes the pgAdmin 4 client as an example to introduce how to connect to an RDS instance. You can also adopt this method when using other clients. When you connect to an RDS instance through a client, choose to use an intranet or Internet address as follows:

  • Use the intranet IP address when your client is installed on the ECS that is located in the same region and the same network type as the RDS instance to be connected.
  • Use the Internet IP address for the other situations.

Log on through a client

  1. Add the IP address that is allowed to access the RDS instance to the RDS whitelist. For more information, see Set whitelist.
  2. Start the pgAdmin 4 client.
  3. Right click Servers, and then select Create > Server, as shown in the following figure.


  4. On the General tab of Create - Server window, enter server name, as shown in the following figure.


  5. Click the Connection tab, enter the information of the instance to be connected, as shown in the following figure.


    Parameters description:

    • Host name/address: refers to the connection address of the RDS instance. If your application accesses the RDS instance through the intranet, enter the intranet IP address of the RDS instance. If your application accesses the RDS instance through the Internet, enter the Internet IP address of the RDS instance. Perform the following steps to find the connection address and port number of the RDS instance.
      1. Log on to the RDS console.
      2. Select the region where the target instance is located.
      3. Click the ID of the instance to visit the Basic Information page.
      4. In the Basic Information area, you can find the connection addresses and port numbers of the RDS instance.
    • Port: refers to the port number of the RDS instance. If your application accesses the RDS instance through the intranet, enter the intranet port number of the RDS instance. If your application accesses the RDS instance through the Internet, enter the Internet port number of the RDS instance.
    • Username: refers to the initial account name of the RDS instance.
    • Password: refers to the password of the initial account name of the RDS instance.
  6. Click Save.
  7. If the connection information is correct, select Servers > server name > Databases > postgres. The following interface is displayed, which indicates that the connection to RDS instance is successful.
    Note
    Postgres is the default system database of the RDS instance. Do not perform any operation in this database.