This topic describes how to view the version of Babelfish that is enabled for an ApsaraDB RDS for PostgreSQL instance. You can connect your application to the RDS instance over the Tabular Data Stream (TDS) port or PostgreSQL port to view the version.

Prerequisites

Connect to the RDS instance over the TDS port to view the Babelfish version

  1. Run the following command to connect to the RDS instance over the TDS port:
    sqlcmd -S pgm-****.pg.rds.aliyuncs.com,1433 -U babelfish_user
  2. Execute the following statement to check whether the connection to the RDS instance is established over the TDS port:
    SELECT CAST(serverproperty('babelfish') AS BIT) AS is_run_on_babelfish;
    GO
    Sample output:
    is_run_on_babelfish
    -------------------
                      1
    
    (1 rows affected)
  3. Execute the following statement to view the version of Babelfish:
    SELECT CAST(serverproperty('babelfishversion') AS VARCHAR(5)) as babelfish_version;
    GO
    Sample output:
    babelfish_version
    -----------------
    1.2.0
    
    (1 rows affected)
  4. Execute the following statement to view the version details of Babelfish:
    SELECT @@version as version;
    GO
    Sample output:
    version
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Babelfish for PostgreSQL with SQL Server Compatibility - 12.0.2000.8
    PostgreSQL 13.6
    
    (1 rows affected)

Connect to the RDS instance over the PostgreSQL port to view the Babelfish version

  1. Run the following command to 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. Execute the following statement to view the version of Babelfish:
    SELECT
        version() as postgresql_version,
        sys.version() as babelfish_compatibility,
        sys.SERVERPROPERTY('BabelfishVersion') as babelfish_Version;
    Sample 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)