All Products
Search
Document Center

ApsaraDB RDS:Use clients to establish connections

Last Updated:Mar 28, 2026

Connect to an ApsaraDB RDS for PostgreSQL instance with Babelfish enabled using SQL Server clients over the Tabular Data Stream (TDS) port. This topic covers four clients: TSQL (FreeTDS), sqlcmd, SQL Server Management Studio (SSMS), and Azure Data Studio.

Babelfish supports two connection paths: SQL Server clients connect on the TDS port (default: 1433), and PostgreSQL clients connect on the PostgreSQL port. To connect over the PostgreSQL port, see Connect to an ApsaraDB RDS for PostgreSQL instance.

Known limitations

Before you connect, review this compatibility constraint:

  • SSMS Object Explorer is not supported. Babelfish is not fully compatible with all SQL Server system tables. Connecting through Object Explorer triggers a Specified case is not valid error. Use File > New > Database Engine Query instead.

Prerequisites

Before you begin, ensure that you have:

Connect using TSQL (FreeTDS)

  1. Install TSQL (FreeTDS). The following example uses CentOS 7.

    sudo yum install -y freetds
  2. Connect to the RDS instance.

    tsql -S pgm-****.pg.rds.aliyuncs.com -p 1433 -U babelfish_user
    • -S: The endpoint of the RDS instance, for example, pgm-****.pg.rds.aliyuncs.com.

    • -p: The TDS port number, for example, 1433.

    • -U: The username of the Babelfish account, for example, babelfish_user.

  3. Verify the connection by running a SQL query.

    SELECT name FROM sys.databases;
    GO

    For common SQL operations, see Common operations and compatibility description.

Connect using sqlcmd

  1. Download and install sqlcmd. For more information, see Download and install sqlcmd in the Microsoft SQL Server documentation.

  2. Connect to the RDS instance.

    sqlcmd -S pgm-****.pg.rds.aliyuncs.com,1433 -U babelfish_user
    • -S: The endpoint and TDS port in the format Endpoint,Port, for example, pgm-****.pg.rds.aliyuncs.com,1433.

    • -U: The username of the Babelfish account, for example, babelfish_user.

  3. Verify the connection by running a SQL query.

    SELECT name FROM sys.databases;
    GO

    For common SQL operations, see Common operations and compatibility description.

Connect using SSMS

Important

Do not use Object Explorer to create the connection. Babelfish is not fully compatible with all SQL Server system tables, so Object Explorer connections fail with a Specified case is not valid error. Use File > New > Database Engine Query as described below.

  1. Download and install SQL Server Management Studio (SSMS). For more information, see Download SSMS in the Microsoft SQL Server documentation.

  2. Open SSMS. In the menu bar, choose File > New > Database Engine Query.

    新建连接

  3. Configure the connection parameters and click Connect.

    连接PG

    ParameterValueDescription
    Server typeDatabase EngineFixed value.
    Server namepgm-****.pg.rds.aliyuncs.com,1433The endpoint and TDS port in the format Endpoint,Port.
    AuthenticationSQL Server AuthenticationFixed value.
    Loginbabelfish_userThe username of the Babelfish account.
    Passwordbabelfish_pwdThe password of the Babelfish account.

Connect using Azure Data Studio

Note

The following steps use Azure Data Studio 1.45.1 as an example.

  1. Download and install Azure Data Studio. For more information, see Download and install Azure Data Studio in the Microsoft SQL Server documentation.

  2. Open Azure Data Studio and click Create a connection.

    创建连接

  3. Configure the connection parameters and click Connect.

    image.png

    ParameterValueDescription
    Connection typeMicrosoft SQL ServerFixed value.
    Serverpgm-****.pg.rds.aliyuncs.com,1433The endpoint and TDS port in the format Endpoint,Port.
    Authentication typeSQL LoginFixed value.
    User namebabelfish_userThe username of the Babelfish account.
    Passwordbabelfish_pwdThe password of the Babelfish account.
    EncryptOptional (False)Fixed value.

FAQ

Why does SSMS show `Specified case is not valid. (Micosoft.SqlServer.ConnectionInfo)` when I connect?

Babelfish is not fully compatible with all SQL Server system tables, so connecting through Object Explorer fails.

对象资源管理器报错

Use File > New > Database Engine Query instead to open the connection dialog directly.

新建连接