Skip to content
babelfishpg_tsql

babelfishpg_tsql

babelfish : SQL Server Transact SQL compatibility

Overview

ID Extension Package Version Category License Language
9310
babelfishpg_tsql
babelfish
5.4.0
SIM
Apache-2.0
C
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--s-d-r
No
Yes
No
Yes
yes
no
Relationships
Requires
babelfishpg_common
uuid-ossp
Need By
babelfishpg_tds
See Also
babelfishpg_money
pg_hint_plan
tds_fdw
session_variable
orafce
pgtt
db_migrator
Siblings
babelfishpg_common
babelfishpg_tds
babelfishpg_money

special case: this extension only works on wiltondb kernel fork

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PIGSTY
5.4.0
18
17
16
15
14
babelfish babelfishpg_common, uuid-ossp
RPM
PIGSTY
6.0.0
18
17
16
15
14
babelfish-$v antlr4-runtime413
DEB
PIGSTY
6.0.0
18
17
16
15
14
babelfish-$v libantlr4-runtime413
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
el8.aarch64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
el9.x86_64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
el9.aarch64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
el10.x86_64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
el10.aarch64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
d12.x86_64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
d12.aarch64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
d13.x86_64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
d13.aarch64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
u22.x86_64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
u22.aarch64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
u24.x86_64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
u24.aarch64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
u26.x86_64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A
u26.aarch64
PIGSTY 6.0.0
PIGSTY 5.4.0
N/A
N/A
N/A

Source

pig build pkg babelfish;		# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u   # add both repo and update cache

Install this extension with pig:

pig install babelfish;		# install via package name, for the active PG version
pig install babelfishpg_tsql;		# install by extension name, for the current active PG version

pig install babelfishpg_tsql -v 18;   # install for PG 18
pig install babelfishpg_tsql -v 17;   # install for PG 17

Create this extension with:

CREATE EXTENSION babelfishpg_tsql CASCADE; -- requires babelfishpg_common, uuid-ossp

Usage

Sources:

babelfishpg_tsql implements the T-SQL language and SQL Server-compatible catalog behavior used by Babelfish. It is one component of a Babelfish database, not a compatibility layer that can be added to stock PostgreSQL by itself: the complete stack requires the Babelfish-patched PostgreSQL engine plus the common, TDS, and T-SQL extensions.

Core Workflow

Configure the TDS protocol extension for preload and restart the Babelfish server:

shared_preload_libraries = 'babelfishpg_tds'

Create the TDS extension with CASCADE so its extension dependencies, including babelfishpg_tsql, are installed. Choose the migration mode before initialization.

CREATE EXTENSION IF NOT EXISTS babelfishpg_tds CASCADE;

ALTER SYSTEM SET babelfishpg_tsql.database_name = 'babelfish_db';
ALTER SYSTEM SET babelfishpg_tsql.migration_mode = 'multi-db';

CALL sys.initialize_babelfish('babelfish_user');

After configuration is reloaded as directed by the installation guide, SQL Server clients connect to the TDS listener, commonly on port 1433, and issue T-SQL in the logical databases created by Babelfish.

Component and Object Index

  • babelfishpg_tsql supplies the T-SQL parser, procedural language, system objects, compatibility functions, and T-SQL configuration variables.
  • babelfishpg_tds supplies the Tabular Data Stream listener and is the normal installation entry point.
  • babelfishpg_common supplies shared data types and functions. It and uuid-ossp are declared dependencies of babelfishpg_tsql.
  • babelfishpg_money supplies money-related compatibility objects used by the stack.
  • sys.initialize_babelfish(login_name) provisions the Babelfish catalogs and initial login.
  • sys.sp_babelfish_configure controls documented compatibility escape hatches.
  • babelfishpg_tsql.database_name identifies the physical PostgreSQL database hosting Babelfish.
  • babelfishpg_tsql.migration_mode selects single-db or multi-db logical-database mapping.

Operational Boundaries

Installation requires superuser privileges and a Babelfish build matched to the extension release. Do not install babelfishpg_tsql alone and expect TDS connectivity. The migration mode is a provisioning decision and is not intended to be changed after the database is initialized.

Babelfish implements a substantial but incomplete SQL Server surface. Validate application syntax, data types, system-catalog assumptions, drivers, and escape-hatch settings against the official limitations before migration. PostgreSQL and T-SQL connections can observe different naming and transaction semantics.

The catalog change from 5.5.0 to 5.4.0 is a version correction to the official BABEL_5_4_0 release line, not evidence of a new feature or an automatic downgrade procedure.

Last updated on