SQL Server (Babelfish)
Babelfish for PostgreSQL provides SQL Server wire-protocol compatibility, letting you connect SQL Server clients and run T-SQL queries without modifying your application.
Connecting
Two ports are available:
| Port | Protocol | Client |
|---|---|---|
1433 | TDS (SQL Server wire) | SQL Server drivers, SSMS, sqlcmd |
5432 | PostgreSQL | psql, JDBC, all PostgreSQL clients |
SQL Server clients
# sqlcmd
sqlcmd -S HOST,1433 -U USER -P PASS -Q "SELECT @@VERSION"
# Connection string (.NET / ADO.NET)
Server=HOST,1433;Database=defaultdb;User Id=USER;Password=PASS;Encrypt=true;TrustServerCertificate=false;
# JDBC (SQL Server driver)
jdbc:sqlserver://HOST:1433;databaseName=defaultdb;user=USER;password=PASS;encrypt=true;
PostgreSQL clients
PGPASSWORD=PASS psql "host=HOST user=USER dbname=defaultdb sslmode=verify-full"
T-SQL Compatibility
Babelfish supports a large subset of T-SQL syntax including:
SELECT,INSERT,UPDATE,DELETE,MERGE- Stored procedures (
CREATE PROCEDURE) - Functions (
CREATE FUNCTION) - Triggers (
CREATE TRIGGER) - SQL Server data types (
NVARCHAR,DATETIME,UNIQUEIDENTIFIER,BIT, etc.) sys.catalog views (partial emulation)INFORMATION_SCHEMAviewsSEToptions (NOCOUNT,ANSI_NULLS, etc.)
Known Limitations
Not all SQL Server features are supported. Common gaps:
| Feature | Status |
|---|---|
| SQL Server Agent jobs | Not supported |
| Linked servers | Not supported |
| CLR integration | Not supported |
| Full-text search | Not supported |
OPENROWSET / OPENDATASOURCE | Not supported |
| Distributed transactions (MSDTC) | Not supported |
| Change Data Capture (CDC) | Not supported |
FOR XML clauses | Limited support |
| Spatial data types | Limited support |
For the full compatibility matrix, see the Babelfish documentation.
Database Users
Create a user with SQL Server-compatible credentials:
curl -u admin:password -X POST \
https://api.foundrydb.com/managed-services/{id}/database-users \
-H "Content-Type: application/json" \
-d '{"username": "app_user", "role": "admin"}'
Configuration
Babelfish runs on top of PostgreSQL. PostgreSQL-level tuning applies:
curl -u admin:password -X PATCH \
https://api.foundrydb.com/managed-services/{id}/configuration \
-H "Content-Type: application/json" \
-d '{
"parameters": {
"max_connections": "200",
"shared_buffers": "2GB"
}
}'
Backups
Backups use pgBackRest on the underlying PostgreSQL instance. PITR is available to any second within the retention window:
curl -u admin:password -X POST \
https://api.foundrydb.com/managed-services/{id}/backups/restore \
-H "Content-Type: application/json" \
-d '{"restore_point": "2026-03-15T14:30:00Z", "target_service_name": "restored-mssql"}'