All Products
Search
Document Center

PolarDB:Connect to a PolarDB for PostgreSQL(Compatible with Oracle) cluster

Last Updated:Mar 28, 2026

Connect to your PolarDB for PostgreSQL(Compatible with Oracle) cluster using pgAdmin 4, a graphical client that lets you run queries and manage your data.

Other connection methods

You can also use the command-line interface (CLI) — download it from Download clients and drivers. For driver-based connections, see:

Prerequisites

Before you begin, make sure you have:

Get your connection details

Before opening pgAdmin 4, collect the following information from the PolarDB console. Having these details ready avoids interruptions during the connection setup.

DetailValueWhere to find it
EndpointThe endpoint of your PolarDB clusterPolarDB console > cluster ID > Endpoints section
Port1521 (default)PolarDB console > cluster ID > Endpoints section
Maintenance databasepostgres (default)N/A
UsernameYour cluster account nameThe account you created for the cluster
PasswordYour cluster account passwordThe password for that account

Internal vs. public endpoint: Use the internal endpoint if your client is on the same virtual private cloud (VPC) or classic network as the cluster. Use the public endpoint if you're connecting over the Internet. Using the wrong endpoint type causes connection failures.

To find the endpoint:

  1. Log on to the PolarDB console.

  2. In the upper-left corner, select the region where your cluster is deployed.

  3. On the Clusters page, click the ID of your cluster.

  4. In the Endpoints section, copy the appropriate endpoint.

Connect using pgAdmin 4

  1. Launch pgAdmin 4.

  2. Right-click Servers and choose Create > Server.

    Create a server

  3. On the General tab of the Create - Server dialog, enter a name for this connection.

    pgAdmin 4 - General

  4. Click the Connection tab and fill in the cluster details using the values you collected earlier.

    ParameterValue
    Host name/addressThe endpoint of your PolarDB cluster
    Port1521
    Maintenance databasepostgres
    UsernameYour PolarDB cluster account
    PasswordThe password for the account

    pgAdmin 4 - Connection

  5. Click Save.

  6. Click the database name. A dashboard similar to the following page confirms the connection is established.

    Connection established

  7. Right-click the database name and select Query Tool... to open the query editor, where you can add, delete, update, and query data.

    Query editor

What's next

Oracle compatibility

Troubleshooting

If the connection fails immediately, check the most common causes in order:

  1. Whitelist not configured — connection is refused immediately

  2. Wrong endpoint type — connection times out or is refused even with a correct whitelist

  3. DNS resolution failure — pgAdmin 4 cannot resolve the hostname

Whitelist not configured

The default whitelist contains only 127.0.0.1. In PolarDB, 127.0.0.1 indicates that no IP address is allowed to access the cluster. Add your client's IP address to the whitelist — see Configure a whitelist for a cluster.

Common whitelist mistakes:

MistakeFix
Entry set to 0.0.0.0Use 0.0.0.0/0 instead
Dynamic IP address listedRe-check your current public IP address and update the whitelist
Important

0.0.0.0/0 allows all IP addresses to connect. Use it with caution.

Wrong endpoint type

Using an internal endpoint over the Internet, or a public endpoint over an internal network, causes connection failures. Match the endpoint type to your network:

NetworkEndpoint to use
Same VPC or classic network as the clusterInternal endpoint
InternetPublic endpoint

DNS resolution failure

Check the following in order:

  1. Verify the endpoint. Log on to the PolarDB console and confirm the endpoint in the Endpoints section. Copy it directly to avoid typos.

  2. Check if the public endpoint was deleted. If the endpoint no longer appears in the console, it may have been manually removed.

  3. Check for truncation. Some applications limit endpoint string length. Verify that the full endpoint is passed to pgAdmin 4.

  4. Update your DNS server. If the endpoint is valid but still fails to resolve, switch to an Alibaba Cloud DNS server:

    Network typeDNS server IP addresses
    Internal network (classic network)10.143.22.116 and 10.143.22.118
    Internal network (VPC)100.100.2.136 and 100.100.2.138
    Internet223.5.5.5 and 223.6.6.6