Babelfish
Babelfish is a PostgreSQL-based SQL Server compatibility layer, open-sourced by AWS.
Overview
Deploy Babelfish in mssql mode to add these features to PostgreSQL:
- SQL Server wire protocol compatibility (TDS,
1433) - T-SQL compatibility
- Unified integration with Pigsty capabilities (HA, backup, monitoring, IaC)
Pigsty provides PostgreSQL 17/18-compatible Babelfish packages. The template defaults to pg_version: 17. See the package lists for version and platform availability.
./configure -c mssql ignores -v. To select PG18, explicitly adjust the generated configuration and check packages. In development sources, -v overrides the version for fork/mssql; see the MSSQL template.
Current Behavior
The current behavior differs from older Babelfish/PG15 documentation as follows:
- Supported kernel majors are PG17/18; the template defaults to PG17 (
pg_version: 17) - Default package group:
babelfish + pgsql-common + sqlcmd - Mainstream platform coverage:
- OS:
el8,el9,el10,d12,d13,u22,u24,u26 - Arch:
x86_64,aarch64
- OS:
mssqltemplate no longer requires an extramssqlrepo module (defaults tonode,infra,pgsql)
Older docs may still contain deprecated naming. Pigsty now consistently uses
Babelfishandbabelfishaliases.
Quick Start
Use the built-in Pigsty template:
The commands below use the v4.5.0 template. Development sources moved it to conf/fork/mssql.yml; use -c fork/mssql with those sources.
After deployment, connect directly with SQL Server clients:
Key Configuration
Core parameters in the mssql template:
Connectivity and Ports
Babelfish clusters expose two protocol endpoints:
- PostgreSQL protocol:
5432 - SQL Server protocol (TDS):
1433
Through Pigsty services, you can also use these ports:
5433: fixed route to primary14335434: route to readable node1433
Notes
- Babelfish auth rules must use
md5instead of defaultscram-sha-256. - Default migration mode is
multi-db; switch withbabelfishpg_tsql.migration_modeif needed. - Some native PostgreSQL extensions cannot run directly on Babelfish kernels. Verify package availability and compatibility first.
- For production, restrict HBA rules and network access. Do not keep the open rules from the demonstration configuration.
Related Docs
Available Extensions
The table lists selected non-Contrib extensions for reference. Query the target instance to confirm actual availability and versions.
| Extension | Version | Description |
|---|---|---|
| babelfishpg_common | 5.4.0 | Transact SQL Datatype Support |
| babelfishpg_money | 1.1.0 | babelfishpg_money |
| babelfishpg_tds | 1.0.0 | TDS protocol extension |
| babelfishpg_tsql | 5.4.0 | Transact SQL compatibility |
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)