All Products
Search
Document Center

ApsaraDB RDS:View the version of Babelfish

Last Updated:Mar 28, 2026

Query the Babelfish version running on your ApsaraDB RDS for PostgreSQL instance using either the Tabular Data Stream (TDS) port or the PostgreSQL port.

Prerequisites

Before you begin, ensure that you have:

Query over the TDS port

Use sqlcmd to connect over the TDS port (1433) and run three queries: one to confirm the connection is a Babelfish connection, one to get the Babelfish version number, and one to get full version details.

  1. Connect to the RDS instance over the TDS port.

    sqlcmd -S pgm-****.pg.rds.aliyuncs.com,1433 -U babelfish_user
  2. Confirm that you are connected to a Babelfish instance, not a native SQL Server instance.

    SELECT CAST(serverproperty('babelfish') AS BIT) AS is_run_on_babelfish;
    GO

    Expected output:

    is_run_on_babelfish
    -------------------
                      1
    
    (1 rows affected)
  3. Get the Babelfish version number.

    SELECT CAST(serverproperty('babelfishversion') AS VARCHAR(5)) as babelfish_version;
    GO

    Expected output:

    babelfish_version
    -----------------
    1.2.0
    
    (1 rows affected)
  4. Get full version details, including the PostgreSQL version and the SQL Server compatibility level.

    SELECT @@version as version;
    GO

    Expected output:

    version
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Babelfish for PostgreSQL with SQL Server Compatibility - 12.0.2000.8
    PostgreSQL 13.6
    
    (1 rows affected)

Query over the PostgreSQL port

Use psql to connect over the PostgreSQL port (5432) and retrieve the Babelfish version, PostgreSQL version, and SQL Server compatibility level in a single query.

  1. Connect to the RDS instance over the PostgreSQL port.

    psql -h pgm-****.pg.rds.aliyuncs.com -p 5432 -U babelfish_user -d babelfish_db
  2. Query all three version dimensions at once.

    SELECT
        version() as postgresql_version,
        sys.version() as babelfish_compatibility,
        sys.SERVERPROPERTY('BabelfishVersion') as babelfish_Version;

    Expected output:

    postgresql_version |                       babelfish_compatibility                        | babelfish_version
    --------------------+----------------------------------------------------------------------+-------------------
     PostgreSQL 13.6    | Babelfish for PostgreSQL with SQL Server Compatibility - 12.0.2000.8+| 1.2.0
                        | PostgreSQL 13.6                                                      |
    (1 row)

What's next