查询 Babelfish 以查找 Babelfish 的详细信息
您可以查询 Babelfish 以查找有关 Babelfish 版本、Aurora PostgreSQL 版本和兼容的 Microsoft SQL Server 版本的详细信息。
在连接到 TDS 端口时运行这些查询。
要确定 Babelfish 版本,请运行以下查询:
SELECT CAST(serverproperty('babelfishversion') AS VARCHAR)
该查询返回的结果类似于以下内容:
1.0.0要确定 Aurora PostgreSQL 数据库集群的版本,请运行以下查询:
SELECT aurora_version() AS aurora_version
该查询返回的结果类似于以下内容:
13.4.0要确定兼容的 Microsoft SQL Server 版本,请运行以下查询:
SELECT @@VERSION AS version
该查询返回的结果类似于以下内容:
Babelfish for Aurora Postgres with SQL Server Compatibility - 12.0.2000.8
Sep 28 2021 14:37:26
Copyright (c) Amazon Web Services
PostgreSQL 13.4 on x86_64-pc-linux-gnu
此外,以下查询在 Babelfish 上执行时返回 1,在 Microsoft SQL Server 上执行时返回 NULL:
SELECT CAST(serverproperty('babelfish') AS VARCHAR) AS runs_on_babelfish
要使用 PostgreSQL 端口以同样的方式查询 babelfish_db,请连接到 babelfish_db 并运行以下命令。
\x SELECT aurora_version() as aurora_version, version() as postgresql_version, sys.version() as Babelfish_compatibility, sys.SERVERPROPERTY('BabelfishVersion') as Babelfish_Version
该查询返回以下内容。
babelfish_db=> \x
Expanded display is on.
babelfish_db=> SELECT
babelfish_db-> aurora_version() as aurora_version,
babelfish_db-> version() as postgresql_version,
babelfish_db-> sys.version() as Babelfish_compatibility,
babelfish_db-> sys.SERVERPROPERTY('BabelfishVersion') as Babelfish_Version ;
-[ RECORD 1 ]
aurora_version | 13.4.0
postgresql_version | PostgreSQL 13.4 on aarch64-unknown-linux-gnu, compiled by aarch64-unknown-linux-gnu-gcc (GCC) 7.4.0, 64-bit
babelfish_compatibility | Babelfish for Aurora Postgres with SQL Server Compatibility - 12.0.2000.8 +
| Oct 13 2021 17:34:47 +
| Copyright (c) Amazon Web Services +
| PostgreSQL 13.4 on aarch64-unknown-linux-gnu
babelfish_version | 1.0.0