Before connecting to a DB instance, you must create one first. For details about how to create a DB instance, see Buying an RDS for PostgreSQL Instance. You can connect to an RDS for PostgreSQL instance through a command-line interface (CLI), graphical user interface (GUI), Data Admin Service (DAS), or Java database connectivity (JDBC).
Connection Method | Connection Address | Description |
|---|---|---|
Connecting to an RDS for PostgreSQL Instance Through DAS (Recommended) | Not required | DAS enables you to manage databases on a web-based console and provides you with database development, O&M, and intelligent diagnosis to make it easy to use and maintain your databases. The permissions required for connecting to DB instances through DAS are enabled by default. |
For details, see Connecting to a DB Instance over a Private or Public Network Using a CLI. | In Linux, you need to install a PostgreSQL client on the ECS and connect to the instance through the psql CLI over a private or public network.
| |
EIP for read/write | In Windows, you can use the pgAdmin client to connect to an RDS for PostgreSQL instance. | |
Floating IP address for read/write or EIP for read/write | RDS for PostgreSQL is compatible with the community ecosystem and does not provide driver services. You can choose any community driver version as required. If you are connecting to an instance through JDBC, the SSL certificate is optional. For security reasons, you are advised to download the SSL certificate to encrypt the connection. |
Table 2 lists how to use a CLI to connect to an RDS for PostgreSQL instance over a private or public network.
Figure 1 Connecting to a DB instance over a private or public network

Connection Method | IP Address | Security Group Rules | Description |
|---|---|---|---|
Floating IP address |
|
| |
An EIP must be purchased. | To access a DB instance from resources outside the security group that the DB instance is associated with, you need to configure an inbound rule for the security group. For details, see Configuring Security Group Rules. |
|
This IP address is always bound to the primary node. If your applications are deployed on a server that is in the same VPC as your DB instance, you can connect to the DB instance using this IP address to perform read and write operations. If a failover occurs, this IP address will be bound to the new primary node and can still be used for read and write operations. All operations on this IP address will be performed on the primary node.
After you buy an EIP and bind it to an instance, you can use this IP address to perform read and write operations on the instance. Just like a floating IP address, an EIP is always bound to the primary node for read and write operations. All operations on this IP address will be performed on the primary node.