All Products
Search
Document Center

ApsaraDB RDS:[Product changes/Feature changes] Change of the default port number from 1921 to 5432 for new ApsaraDB RDS for PostgreSQL instances

Last Updated:Oct 13, 2023

Starting September 24, 2021, the default port number of new ApsaraDB RDS for PostgreSQL instance that you purchase is 5432. The default port number remains 1921 for existing ApsaraDB RDS for PostgreSQL instances.

Effective date

September 24, 2021

Description

The default port number of each new ApsaraDB RDS for PostgreSQL instance that you purchase is 5432.

Impacts

  • For an existing ApsaraDB RDS for PostgreSQL instance, the default port number is 1921.

  • For a new ApsaraDB RDS for PostgreSQL instance, the default port number is 5432. The following table describes the impacts of the change.

    Note

    For more information about how to connect to an RDS instance, see Connect to an ApsaraDB RDS for PostgreSQL instance.

    Connection method

    Impact

    Connection example

    Use Data Management (DMS) to connect to the RDS instance

    None.

    You do not need to specify the port number.

    You need to only configure the Instance ID, Database Account, and Database Password parameters.

    DMS登录数据库

    Use the CLI to connect to the RDS instance

    None.

    You do not need to specify the port number. The client connects to the new ApsaraDB RDS for PostgreSQL instance over the default port 5432.

    You need to only specify the endpoint of the new ApsaraDB RDS for PostgreSQL instance, the username of the authorized account, and the name of the database and enter a correct password.

    psql -h <The endpoint of the RDS instance> -U <The username of the authorized account> -d <The name of the database>
    pgsql连接

    Use SQL Shell (psql) to connect to an RDS instance

    None.

    You do not need to specify the port number. The connection is established over the default port number 5432.

    You need to only configure the Server, Database, and Username parameters and enter a correct password.

    sql shell连接实例

    Use pgAdmin to connect to the new ApsaraDB RDS for PostgreSQL instance

    You no longer need to set the Port parameter to 1921.

    The connection is established over the default port number 5432.

    You need to only configure the Host name/address, Maintenance database, Username, and Password parameters.

    pgAdmin连接实例

    Use an application to connect to the new ApsaraDB RDS for PostgreSQL instance

    Pay attention to the port number in the business code.

    Set the port number to 5432.

    The following code snippet is an example that is suitable when the Java Database Connectivity (JDBC) API is used:

    String url = "jdbc:postgresql://<The endpoint of the RDS instance>:5432/<The name of the database>";
    String user = "<The username of the authorized account>";
    String password = "<The password of the authorized account>";
    Class.forName("org.postgresql.Driver");
    Connection connection= DriverManager.getConnection(url, user, password);

References

For more information about how to change the port number of an ApsaraDB RDS for PostgreSQL instance, see View and change the internal and public endpoints and port numbers of an ApsaraDB RDS for PostgreSQL instance.