HexaBridge - Oracle Compatibility for PostgreSQL

HexaBridge brings Oracle's types, functions, and packages to Community PostgreSQL - no commercial fork required. The deepest Oracle compatibility layer available.

0
Oracle-Compatible Types
0
Standalone Functions
0
Oracle Packages
0
Total Routines

Industry-Leading Oracle Compatibility

Most Oracle compatibility solutions for PostgreSQL cover only basic functions like NVL, SUBSTR, and DBMS_OUTPUT - typically around 70-80 routines across a handful of packages. Commercial alternatives extend this to approximately 500 routines across 30 packages, but require you to purchase an expensive proprietary fork of PostgreSQL.

HexaBridge delivers over 1,100 routines across 45 Oracle packages - more than double the coverage of any commercial alternative - and it runs on Community PostgreSQL as-is. No proprietary database fork required. From DBMS_SCHEDULER and DBMS_SQL to DBMS_XMLDOM and DBMS_REDACT, HexaBridge covers the packages that real-world Oracle applications actually depend on.

Open-source extensions
0routines
5-8 packages
Commercial forks
0routines
~30 packages
Best
HexaBridge
0routines
45 packages

The compatibility no AI or migration tool can generate

AI and migration tools convert your schema and application code, but they cannot recreate the source database's built-in routines on PostgreSQL. HexaBridge provides exactly that runtime compatibility, so HexaRocket can achieve 100% automatic schema conversion. Without this layer, every built-in function your application relies on becomes a manual rewrite that no tool can fully automate.

Runs on Community PostgreSQL - no commercial fork needed

Works on Community PostgreSQL - No Proprietary Fork Required

Unlike other Oracle compatibility solutions that require a commercial PostgreSQL fork, HexaBridge is a standard PostgreSQL extension that installs on Community PostgreSQL with a simple CREATE EXTENSION command.

HexaBridge is available to customers who migrate their databases using HexaRocket, and to customers of HexaCluster-approved partners. Contact us to learn how HexaBridge can accelerate your Oracle-to-PostgreSQL migration.

Oracle-Compatible Types

17 types including VARCHAR2, NUMBER, DATE, CLOB, BLOB, XMLTYPE, BFILE, RAW

Oracle-Compatible Functions

115+ standalone functions - NVL, DECODE, TO_CHAR, SUBSTR, REGEXP_*, SYS_CONTEXT, and more

Oracle Packages

45 packages with 1,100+ routines - DBMS_SCHEDULER, DBMS_SQL, UTL_HTTP, DBMS_CRYPTO, and more

How It Works

-- Install HexaBridge on Community PostgreSQL
CREATE EXTENSION hexabridge;

-- Set search path for bare-name access
SET search_path TO oracle, public;

-- Use Oracle functions naturally
SELECT NVL(column1, 'default') FROM my_table;
SELECT DBMS_RANDOM.value(1, 100);
SELECT UTL_HTTP.request('https://api.example.com/data');

Oracle-Compatible Data Types

HexaBridge provides 17 Oracle-compatible data types that behave identically to their Oracle counterparts - including strict byte/character length enforcement, Oracle NULL semantics, and Oracle-style arithmetic.

All types are created in the oracle schema. With SET search_path TO oracle, public;, they can be used by bare name - just like in Oracle.

Oracle-Compatible Standalone Functions

HexaBridge provides 115+ standalone Oracle-compatible functions that follow Oracle's exact semantics - including Oracle's NULL/empty-string equivalence, format models, and edge-case behaviors.

String / Character(31)

SUBSTRsubstr(str, pos [, len])Oracle-compatible substring. Position 0 treated as 1, negative position counts from end, empty string returns NULL.
SUBSTR2substr2(str, pos [, len])Substring using UCS-2 code unit positions.
SUBSTR4substr4(str, pos [, len])Substring using Unicode code point positions.
SUBSTRBsubstrb(str, pos [, len])Byte-level substring. Partial multi-byte characters at boundaries replaced with spaces.
SUBSTRCsubstrc(str, pos [, len])Substring using Unicode complete character (grapheme cluster) positions.
INSTRinstr(str, pattern [, pos [, nth]])Oracle-compatible string search. Supports nth occurrence and negative position (backward search).
INSTRBinstrb(str, pattern [, pos [, nth]])Like INSTR but positions are in bytes, not characters.
LENGTHlength(str)Character length with Oracle empty-string-is-NULL semantics.
LENGTH2length2(str)String length in UCS-2 code units.
LENGTH4length4(str)String length in Unicode code points.
LENGTHBlengthb(str)Byte length with Oracle empty-string-is-NULL semantics.
LENGTHClengthc(str)String length in Unicode complete characters (grapheme clusters).
LTRIMltrim(str [, set])Left trim with Oracle empty-string-is-NULL semantics.
RTRIMrtrim(str [, set])Right trim with Oracle empty-string-is-NULL semantics.
LPADlpad(str, len [, pad])Left pad with Oracle empty-string-is-NULL semantics.
RPADrpad(str, len [, pad])Right pad with Oracle empty-string-is-NULL semantics.
CONCATconcat(str1, str2)2-arg concatenation. NULL treated as empty, empty result returns NULL.
REPLACEreplace(str, search [, repl])Replaces all occurrences. 2-arg form deletes matches. NULL search returns str unchanged.
TRANSLATEtranslate(str, from, to)Character-by-character translation.
REVERSEreverse(str)Reverses the character order.
UPPERupper(str)Converts to uppercase.
LOWERlower(str)Converts to lowercase.
INITCAPinitcap(str)Capitalizes the first letter of each word.
ASCIIascii(str)Returns the ASCII code of the first character.
CHRchr(n)Returns the character for the given ASCII code.
NLS_UPPERnls_upper(str [, nls_param])Locale-aware uppercase conversion with optional NLS_SORT collation.
NLS_LOWERnls_lower(str [, nls_param])Locale-aware lowercase conversion with optional NLS_SORT collation.
NLS_INITCAPnls_initcap(str [, nls_param])Locale-aware initial capitalization.
NLSSORTnlssort(str [, nls_param])Returns binary collation sort key. Supports NLS_SORT = BINARY and locale-based sorting.
ASCIISTRasciistr(str)Converts non-ASCII characters to \XXXX Unicode escape sequences.
UNISTRunistr(str)Converts \xxxx Unicode escape sequences to text.

Numeric / Math(22)

ABSabs(n)Absolute value. Overloaded for numeric, double precision, integer, bigint.
CEILceil(n)Smallest integer >= n.
FLOORfloor(n)Largest integer <= n.
MODmod(n2, n1)Modulus with Oracle zero-divisor semantics: mod(x, 0) returns x instead of error.
REMAINDERremainder(n2, n1)IEEE 754 remainder with banker's rounding (round half to even).
POWERpower(n, e)n raised to the eth power.
SQRTsqrt(n)Square root.
EXPexp(n)e raised to the nth power.
LNln(value)Natural logarithm. Overloaded for numeric and double precision.
LOGlog(base, value)Logarithm with specified base.
SIGNsign(n)Returns -1, 0, or 1.
SINsin(n)Sine (argument in radians).
COScos(n)Cosine (argument in radians).
TANtan(n)Tangent (argument in radians).
ASINasin(n)Arc sine (returns radians).
ACOSacos(n)Arc cosine (returns radians).
ATANatan(n)Arc tangent (returns radians).
ATAN2atan2(y, x)Arc tangent of y/x (returns radians).
SINHsinh(n)Hyperbolic sine. Adds numeric overload.
COSHcosh(n)Hyperbolic cosine. Adds numeric overload.
TANHtanh(n)Hyperbolic tangent. Adds numeric overload.
BITANDbitand(n1, n2)Bitwise AND of two numeric values, truncating fractional parts first.

Date / Time(18)

SYSDATEsysdate()Returns current statement start time as timestamp.
SYSTIMESTAMPsystimestamp()Returns current statement start time as timestamp with time zone.
ADD_MONTHSadd_months(date, integer)Adds N months with Oracle end-of-month snapping behavior.
LAST_DAYlast_day(date)Returns the last day of the month containing the given date.
MONTHS_BETWEENmonths_between(date, date)Returns fractional number of months between two dates (31-day basis).
NEXT_DAYnext_day(date, text)Returns the next occurrence of the named weekday after the given date.
ROUNDround(date [, text])Rounds a date to the nearest unit (CC, YYYY, Q, MM, WW, DD, DAY, etc.).
TRUNCtrunc(date [, text])Truncates a date to the start of the specified unit.
NEW_TIMEnew_time(date, tz1, tz2)Converts a timestamp between timezones using Oracle's 18 fixed abbreviations.
DBTIMEZONEdbtimezone()Returns the database timezone.
SESSIONTIMEZONEsessiontimezone()Returns the session timezone.
SYS_EXTRACT_UTCsys_extract_utc(tstz)Extracts the UTC equivalent of a timestamp with time zone.
TZ_OFFSETtz_offset(region)Returns the current UTC offset for a timezone region as +/-HH:MI.
FROM_TZfrom_tz(ts, tz)Attaches a timezone to a plain timestamp.
NUMTODSINTERVALnumtodsinterval(n, unit)Converts a number to a DAY TO SECOND interval.
NUMTOYMINTERVALnumtoyminterval(n, unit)Converts a number to a YEAR TO MONTH interval.
TO_YMINTERVALto_yminterval(text)Converts a string to a YEAR TO MONTH interval. Accepts SQL and ISO 8601 formats.
TO_DSINTERVALto_dsinterval(text [, nls])Converts a string to a DAY TO SECOND interval. Accepts SQL and ISO 8601 formats.

Conversion(12)

TO_CHARto_char(value, format [, nls])Formats datetime or numeric values as text. 11 overloads covering all types. Translates Oracle-specific format tokens (RR, RRRR, SYYYY, TZR, TZD).
TO_DATEto_date(text, format [, nls])Parses a date string into timestamp. Supports RR/RRRR century windowing.
TO_TIMESTAMPto_timestamp(text, fmt [, nls])Parses a string into timestamp without time zone. Supports FF1-FF9 fractional seconds.
TO_TIMESTAMP_TZto_timestamp_tz(text, fmt [, nls])Parses a string into timestamp with time zone. Supports TZR/TZD/TZH:TZM elements.
TO_BINARY_DOUBLEto_binary_double(expr [, fmt [, nls]])Converts to double precision (Oracle BINARY_DOUBLE). Handles 'INF', '-INF', 'NaN'.
TO_BINARY_FLOATto_binary_float(expr [, fmt [, nls]])Converts to real (Oracle BINARY_FLOAT). Handles 'INF', '-INF', 'NaN'.
HEXTORAWhextoraw(hex)Converts a hexadecimal string to bytea (Oracle RAW). Case-insensitive.
RAWTOHEXrawtohex(raw)Converts bytea (Oracle RAW) to an uppercase hexadecimal string.
TO_SINGLE_BYTEto_single_byte(str)Converts fullwidth characters to halfwidth (UTF-8).
TO_MULTI_BYTEto_multi_byte(str)Converts halfwidth characters to fullwidth (UTF-8).
CONVERTconvert(src, dest_charset [, source_charset])Character set conversion using Oracle charset names (AL32UTF8, WE8ISO8859P1, etc.).
VALIDATE_CONVERSIONvalidate_conversion(expr, type_name [, fmt [, nlsparam]])Returns 1 if expr can be converted to type_name, 0 otherwise. Accepts Oracle type names.

NULL / Conditional(7)

NVLnvl(expr1, expr2)Returns expr1 if not NULL, otherwise expr2. Polymorphic - works with any data type.
NVL2nvl2(expr1, expr2, expr3)If expr1 IS NOT NULL returns expr2, else expr3.
NANVLnanvl(n1, n2)Returns n2 if n1 is NaN, otherwise returns n1.
LNNVLlnnvl(condition)Returns TRUE if condition is FALSE or NULL.
DECODEdecode(expr, s1, r1 [, s2, r2, ...] [, default])Oracle-compatible conditional expression. Unlike CASE, treats NULL=NULL as true.
GREATESTgreatest(expr, ...)Returns greatest value. Unlike PG built-in, returns NULL if ANY argument is NULL.
LEASTleast(expr, ...)Returns least value. Unlike PG built-in, returns NULL if ANY argument is NULL.

Regular Expressions(5)

REGEXP_LIKEregexp_like(src, pattern [, modifier])Oracle-compatible regex match test. Translates Oracle match flags to PG equivalents.
REGEXP_INSTRregexp_instr(src, pattern [, pos [, occ [, retopt [, mod [, subexpr]]]]])Returns position of regex match (1-based). Supports occurrence, return_option, subexpression.
REGEXP_SUBSTRregexp_substr(src, pattern [, pos [, occ [, mod [, subexpr]]]])Extracts substring matching regex. Supports occurrence and subexpression capture groups.
REGEXP_REPLACEregexp_replace(src, pattern [, repl [, pos [, occ [, mod]]]])Regex-based string replacement. Default replaces all occurrences (Oracle semantics).
REGEXP_COUNTregexp_count(src, pattern [, pos [, modifier]])Counts non-overlapping regex matches.

Aggregate / Statistical(7)

LISTAGGlistagg(expr [, delimiter])Concatenates values into a string with optional delimiter. Supports DISTINCT and ORDER BY.
MEDIANmedian(expr)Returns the median value. Equivalent to percentile_cont(0.5) but simpler syntax.
STATS_MODEstats_mode(expr)Returns the most frequently occurring value. Ties resolved by lowest value.
SKEWNESS_POPskewness_pop(expr)Population skewness (third standardized moment).
SKEWNESS_SAMPskewness_samp(expr)Sample skewness (adjusted Fisher-Pearson coefficient).
KURTOSIS_POPkurtosis_pop(expr)Population excess kurtosis (fourth standardized moment minus 3).
KURTOSIS_SAMPkurtosis_samp(expr)Sample excess kurtosis (G2 estimator).

Environment / Session(4)

SYS_CONTEXTsys_context(namespace, attribute [, length])Oracle-compatible session info retrieval. Supports USERENV namespace (SESSION_USER, CURRENT_USER, DB_NAME, IP_ADDRESS, SID, ISDBA, MODULE, ACTION, NLS_*, etc.) and custom namespaces.
SYS_GUIDsys_guid()Generates a globally unique 32-character uppercase hex identifier (RAW(16)). Cryptographic random.
UIDuid()Returns the numeric user ID of the session user (PG role OID).
USERENVuserenv(parameter)Legacy session environment info function. Supports LANGUAGE, ISDBA, LANG, SESSIONID, SID, INSTANCE, TERMINAL, CLIENT_INFO.

Hash / Cryptographic(3)

ORA_HASHora_hash(expr [, max_bucket [, seed]])Hash function returning bigint in [0, max_bucket]. Default max_bucket=4294967295.
STANDARD_HASHstandard_hash(expr [, method])Cryptographic hash (SHA1, SHA256, SHA384, SHA512, MD5). Default SHA1. Output matches Oracle.
DUMPdump(expr [, fmt [, start_position [, length]]])Returns internal representation of a value. Supports octal, decimal, hex, char formats.

JSON(2)

JSON_MERGEPATCHjson_mergepatch(target, patch)RFC 7396 JSON Merge Patch. Recursively merges two JSON documents.
JSON_EQUALjson_equal(json1, json2)Semantic JSON equality comparison (key order and whitespace ignored).

LOB(2)

EMPTY_BLOBempty_blob()Returns an empty bytea (equivalent to Oracle's empty BLOB locator).
EMPTY_CLOBempty_clob()Returns an empty text (equivalent to Oracle's empty CLOB locator).

Oracle-Compatible Packages

HexaBridge implements 45 Oracle packages with over 1,100 routines - covering database administration, security, networking, file I/O, XML processing, job scheduling, data redaction, and more. Each package mirrors the Oracle API so that existing Oracle PL/SQL code works with minimal changes on PostgreSQL.

Database Administration

Security & Access Control

Networking & I/O

Data Types & LOBs

Utilities

Web / HTML

Job Scheduling & Queuing

Get HexaBridge for Your Migration

HexaBridge is available to customers who migrate their databases using HexaRocket, and to customers of HexaCluster-approved partners. We may open-source HexaBridge in the future - but you don't have to wait. Contact us today and we'll help you get started.

No proprietary PostgreSQL fork required. HexaBridge works as-is on Community PostgreSQL.

Learn About HexaRocket

Interested in HexaBridge? Available to HexaRocket migration customers and approved partners.