14+ Compatibility (Oracle/MSSQL) Extensions for PostgreSQL

Orafce, Babelfish, oracle_fdw, and other Postgres extensions for Oracle and SQL Server compatibility and migration. Ranked by GitHub stars.

Last reviewed: May 15, 2026
14 extensions
1
orafce
5350 30d

Functions and operators that emulate a subset of functions and packages from the Oracle RDBMS

Compatibility (Oracle/MSSQL)·BSD 0-Clause·C
2
pgmemcache
1750 30d

memcached interface

Compatibility (Oracle/MSSQL)·MIT·C
3
pgtt
96+1 30d

Extension to add Global Temporary Tables feature to PostgreSQL

Compatibility (Oracle/MSSQL)·ISC·C
4
spat
280 30d

Redis-like In-Memory DB Embedded in Postgres

Compatibility (Oracle/MSSQL)·AGPL-3.0·C
5

Extension to add Oracle DBMS_METADATA compatibility to PostgreSQL

Compatibility (Oracle/MSSQL)·PostgreSQL·SQL
6

Registration and manipulation of session variables and constants

Compatibility (Oracle/MSSQL)·GPL-3.0·C
7

Extension to add Oracle DBMS_LOCK full compatibility to PostgreSQL

Compatibility (Oracle/MSSQL)·PostgreSQL·SQL
8

SQL Server Transact SQL Datatype Support

Compatibility (Oracle/MSSQL)·Apache-2.0·C
9

SQL Server Money Data Type

Compatibility (Oracle/MSSQL)·Apache-2.0·C
10

SQL Server TDS protocol extension

Compatibility (Oracle/MSSQL)·Apache-2.0·C
11

SQL Server Transact SQL compatibility

Compatibility (Oracle/MSSQL)·Apache-2.0·C
12

API surface for DocumentDB for PostgreSQL

Compatibility (Oracle/MSSQL)·MIT·C
13

Extension to add Oracle DBMS_JOB full compatibility to PostgreSQL

Compatibility (Oracle/MSSQL)·PostgreSQL·SQL
14

Server side rollback at statement level for PostgreSQL like Oracle or DB2

Compatibility (Oracle/MSSQL)·ISC·C

What is a PostgreSQL Compatibility Extension?

Compatibility extensions add functions, syntax, or even wire-protocol support that mimics another database — letting code, queries, and tools originally written for that database run against Postgres with minimal changes. Orafce ports common Oracle functions (NVL, NVL2, TO_CHAR with Oracle's quirks, DBMS_OUTPUT, dbms_pipe, dbms_alert). Babelfish is AWS's TDS/T-SQL implementation that lets SQL Server clients talk to Aurora Postgres unmodified. Smaller extensions cover narrower compatibility surfaces: pgtt for Oracle global temporary tables, pg_oraviews for Oracle-compatible system views.

When to Add a Compatibility Extension

Use these during database migrations — Orafce significantly reduces the effort to move Oracle PL/SQL code to Postgres by providing drop-in implementations of Oracle's most-used built-in functions. Babelfish enables drop-in SQL Server replacement on AWS Aurora — your existing .NET or Java apps connect with no code changes. Once a migration is complete, decide whether to keep the compatibility layer (lower porting cost for ongoing code, but extra dependency) or rewrite to native Postgres idioms (cleaner long-term, native performance). For greenfield projects, skip these and write idiomatic Postgres from the start.

Frequently Asked Questions

What is Orafce?
Orafce (Oracle Functions for PostgreSQL) is an extension that implements many of Oracle's built-in functions inside Postgres — NVL, NVL2, DECODE, TO_CHAR/TO_DATE with Oracle quirks, DBMS_OUTPUT.put_line, dbms_alert, oracle.month_between, and many more. BSD-licensed, maintained by Pavel Stehule, and used by teams migrating from Oracle to reduce the amount of code that needs rewriting. After installing Orafce, you SET search_path = oracle, public; and Oracle-style queries 'just work.'
Can I migrate from Oracle to Postgres with extensions?
Partially. Orafce + oracle_fdw + ora2pg (a migration tool, not an extension) reduce the work substantially, but a non-trivial Oracle codebase will still need some manual porting — PL/SQL packages, Oracle-specific syntax (CONNECT BY, MERGE quirks), and database-link patterns don't translate one-to-one. Typical migrations see 60-80% of code work unchanged with Orafce, with the rest needing manual review. Tools like Migrating Made Easy from EDB and AWS Schema Conversion Tool automate more of the conversion.
What is Babelfish for Aurora?
Babelfish is AWS's open-source project that adds the TDS protocol and T-SQL dialect to PostgreSQL — letting Microsoft SQL Server clients connect to Aurora Postgres without changing connection strings or queries. Apache 2.0-licensed, available on Aurora Postgres-Compatible. Migration path: point your existing .NET/Java/Python SQL Server app at Aurora's TDS endpoint, and it works. Some T-SQL features aren't yet supported (it's not 100% compatible) — check the latest compatibility matrix before committing.
Are SQL Server queries compatible with Postgres?
Mostly no by default — SQL Server uses T-SQL with proprietary syntax (TOP instead of LIMIT, IDENTITY columns vs SERIAL, GETDATE() vs now(), brackets vs double-quotes for identifiers), and Postgres uses standard ANSI SQL. With Babelfish, ~80%+ of common T-SQL queries work unchanged on Aurora Postgres. Without Babelfish, you need either code rewriting or a translation layer. For new development on Postgres, just write standard SQL — it's portable and avoids both dialect issues.
How much Oracle PL/SQL works in Postgres with Orafce?
Orafce covers most of Oracle's built-in functions but NOT PL/SQL syntax — packages, autonomous transactions, OUT/IN OUT parameters, %ROWTYPE quirks, and Oracle-specific cursor handling all need manual rewriting to PL/pgSQL. For built-in function compatibility (NVL, TO_CHAR, DBMS_OUTPUT, etc.), Orafce covers roughly 90% of common usage. Combined with Postgres' native support for similar concepts (anonymous DO blocks for ad-hoc execution, ARRAY types for collections), migrations typically run 60-80% automated with Orafce + ora2pg.

Manage PostgreSQL Visually

1bench is a modern GUI client for PostgreSQL — install extensions, write queries, and inspect schemas without leaving the IDE.

Try 1bench for PostgreSQL