Updated on 2025-11-14 GMT+08:00

Overview

Before connecting to a DB instance, you must create one first. For details about how to create a DB instance, see Buying a TaurusDB for PostgreSQL Instance. You can connect to a TaurusDB for PostgreSQL instance through a command-line interface (CLI) or graphical user interface (GUI).

Connecting to a DB Instance over a Private Network Using CLI

Table 1 lists how to use CLI to connect to a TaurusDB for PostgreSQL instance over a private network.

Table 1 Connecting to a DB instance over a private network

Connection Method

IP Address

Security Group Rule

Description

Private network

Private IP address

  • If the ECS and TaurusDB for PostgreSQL instance are in the same security group, they can communicate with each other over a private network by default. No security group rules need to be configured.
  • If the ECS and TaurusDB for PostgreSQL instance are in different security groups, configure security group rules for the ECS and TaurusDB for PostgreSQL instance, respectively.
    • TaurusDB for PostgreSQL instance: Configure an inbound rule for the security group associated with the TaurusDB for PostgreSQL instance. For details, see Configuring Security Group Rules.
    • ECS: The default security group rule allows all outbound data packets. In this case, you do not need to configure a security group rule for the ECS. If not all outbound traffic is allowed in the security group, you need to configure an outbound rule for the ECS to allow all outbound packets.
  • Secure and high-performance
  • Recommended

Connection Methods

Table 2 Connection methods

Connection Method

Description

Connecting to a TaurusDB for PostgreSQL Instance Through the psql CLI Client

In Linux, you need to install a PostgreSQL client on the ECS and connect to the instance through the psql CLI.

A private IP address is provided by default.

When your applications are deployed on an ECS that is in the same region and VPC as the TaurusDB for PostgreSQL instance, you are advised to use a private IP address to connect to the instance through the ECS.

In Windows, you can use the pgAdmin, sqlcmd, or SSMS client to connect to a TaurusDB for PostgreSQL instance.