Repository navigation
Releases
v1.0.3
Fixes silently wrong results where Oracle operators were not lowered or (+) was dropped.
Three defects changed results without an error, plus three related gaps found while fixing them. Statements that cannot be lowered safely are now rejected.
Changes
Fixed
(+)was removed lexically whenever the preceding text containedJOIN ... ON, including inside literals and earlier subqueries, turning an outer join into an inner join. The marker is now handled on the parsed tree only.- Division, concatenation,
SYSDATEarithmetic and other Oracle operators were not lowered insideIN,BETWEEN,NOTand analytic functions. For exampleWHERE sal/3 IN (SELECT sal/3 ...)returned no rows, andSUM(n1/2) OVER ()used integer division. MOD,CEIL,REPLACE,TRANSLATEandUPPERwere lowered only when something else sent the statement to the parser. They are now always lowered (REPLACE(s, 'a', '')returned NULL for every row).- Subqueries inside
UPDATE SET,UPDATE/DELETE WHERE,MERGE USINGandINSERT VALUESwere skipped by every rule; they are now lowered like any query block. N''became the identifierNNULL; it is nowNULL.- A
TIMESTAMPliteral with more than six fractional digits could bypass its rejection when nothing else needed the parser.
Compatibility impact
- A redundant
(+)on the optional relation of an ANSILEFT JOINis still accepted. Any other(+)in an ANSIONcondition is rejected withOUTER_JOIN_MIXED(Oracle returns ORA-01468 for a marker on the mandatory side). - A statement with an Oracle operator under an expression node the rules do not handle (for example
COLLATE) is rejected withSCALAR_CONTEXT. - Known limitation:
REPLACE(column, ...)andMOD(column, ...)in a select list return Oracle's rows, but the JDBC metadata precision differs.
Verification
532 differential tests against Oracle 18c XE 18.4.0.0.0 and 724 Maven tests, all passing, including 16 new cases.
Downloads
orafit-jdbc-1.0.3.jar— JDBC driver and offline analyzer. pgJDBC is not bundled; provide it in your application.orafit-jdbc-1.0.3-runtime.tar.gz— SQL runtime:native/for self-managed PostgreSQL,plain/for managed services.SHA256SUMS— SHA-256 checksums for the two files above.
Also on Maven Central: io.github.ltslab:orafit-jdbc:1.0.3
Install / Upgrade
Replace the driver JAR. No runtime reinstall is needed. Re-run the analyzer over your SQL: statements that were silently mistranslated may now be rejected.
Full Changelog: v1.0.2...v1.0.3
v1.0.2
Fixes three cases where CHAR data in UNION branches or CAST was wrongly rejected or padded wrongly.
All three fixes concern fixed-width CHAR handling. There are no SQL runtime changes.
Changes
Fixed
- A
FROMsubquery no longer sees sibling derived tables. A column name shared with a preceding derived table used to match twice and become unresolved, which made aUNIONbranch fail withSET_CHAR_WIDTH. NVL(CHAR column, literal)in aUNIONbranch is accepted. Oracle types it asVARCHAR2with the larger of its two argument widths; blank padding is kept on the first argument. An unprovable width is still rejected.CAST(x AS CHAR(n CHAR))now uses character semantics (CAST('É' AS CHAR(2 CHAR))returns'É 'as in Oracle).
Changed
- The documentation site is deployed only when
docs/changes.
Compatibility impact
CHAR(n CHAR)anywhere other than directly afterAS, for example in DDL, is rejected withCHAR_LENGTH_SEMANTICSinstead of being treated as bytes.- Statements that previously failed with
SET_CHAR_WIDTHfor the two cases above now translate.
Verification
516 differential tests against Oracle 18c XE 18.4.0.0.0 and 694 Maven tests, all passing.
Downloads
orafit-jdbc-1.0.2.jar— JDBC driver and offline analyzer. pgJDBC is not bundled; provide it in your application.orafit-jdbc-1.0.2-runtime.tar.gz— SQL runtime:native/for self-managed PostgreSQL,plain/for managed services.SHA256SUMS— SHA-256 checksums for the two files above.
Also on Maven Central: io.github.ltslab:orafit-jdbc:1.0.2
Install / Upgrade
Replace the driver JAR. No runtime reinstall is needed.
Full Changelog: v1.0.1...v1.0.2
v1.0.1
JSqlParser is now a regular dependency instead of being shaded into the JAR, and CHAR widths in UNION branches are resolved from the database.
This release removes a class-path clash risk, widens set-operation support for physical CHAR(n) columns, and updates the pgJDBC version Orafit is tested against.
Changes
Changed
- JSqlParser is declared as
com.github.jsqlparser:jsqlparser:5.4instead of being shaded. The shaded copy was not relocated, so itsnet.sf.jsqlparserclasses could clash with another JSqlParser on the application class path. - The JAR no longer has a
Main-Class. Run the analyzer withjava -cp orafit-jdbc-1.0.1.jar:<jsqlparser-jar> io.github.orafit.tools.CompatibilityAnalyzer.
Fixed
UNION/UNION ALLbranches that project physicalCHAR(n)columns were rejected withSET_CHAR_WIDTH. Widths are now read from PostgreSQL column metadata and Oracle's set datatype rule is applied: equal widths stayCHAR(n); otherwise the result isVARCHAR2of the largest width, with blank padding and duplicate elimination matching Oracle, and JDBC metadata reports the width. Branches whose width cannot be proven are still rejected.
Dependencies
- Tested against pgJDBC 42.7.14, which fixes CVE-2026-107314 and CVE-2026-107315. pgJDBC is still not a dependency of Orafit; use 42.7.14 or later.
Compatibility impact
- Build tools now resolve JSqlParser transitively and may pick a different version than the tested 5.4. Keep the declared version.
- Scripts that ran
java -jar orafit-jdbc-<version>.jarfor the analyzer must switch tojava -cp. - Previously rejected
CHARset-operation statements may now translate.
Verification
513 differential tests between Oracle 18c XE 18.4.0.0.0 and embedded PostgreSQL 17.10 passing, including 12 new CHAR set-width cases.
Downloads
orafit-jdbc-1.0.1.jar— JDBC driver and offline analyzer. pgJDBC is not bundled; provide it in your application.orafit-jdbc-1.0.1-runtime.tar.gz— SQL runtime:native/for self-managed PostgreSQL,plain/for managed services.SHA256SUMS— SHA-256 checksums for the two files above.
Also on Maven Central: io.github.ltslab:orafit-jdbc:1.0.1
Install / Upgrade
Replace the driver JAR and make sure JSqlParser 5.4 is on the class path. The runtime SQL is unchanged since 1.0.0 and does not need reinstalling.
Full Changelog: v1.0.0...v1.0.1
v1.0.0
First release: a Java 17 JDBC driver and PostgreSQL SQL runtime that absorb the Oracle SQL and JDBC differences Java applications rely on.
Orafit lets an existing Oracle-oriented Java application run on PostgreSQL through pgJDBC. It does not migrate tables or data; use a tool such as Ora2Pg for that. It is not a full Oracle emulator: SQL whose Oracle behavior cannot be reproduced reliably is rejected instead of approximated.
Features
- JDBC driver:
jdbc:orafit:URL andio.github.orafit.jdbc.OrafitDriver, delegating to pgJDBC. Bind parameters, OUT values, JDBC result metadata, update counts, vendor error codes, and transaction state are preserved. - SQL rewriting within the verified scope:
DUAL, empty-string/NULL semantics,ROWNUM, legacy outer joins(+),LISTAGG, hierarchical queries,MERGE,RETURNING INTO. - SQL runtime: a native extension for self-managed PostgreSQL and a plain SQL installer for managed services such as Aurora PostgreSQL.
- Offline analyzer: included in the JAR; scans SQL files without executing them and summarizes what is rewritten, rejected, or out of scope.
Verified coverage (representative cases):
- Numeric:
MOD,REMAINDER,SQRT,CEIL,TO_NUMBER; NUMBER division precision, rounding and overflow. - String:
REPLACE,TRANSLATE,TO_CHAR,UPPER,RPAD,LENGTH;CHARblank-padding comparison; mixed-typeNULLIF/COALESCEdatatype errors. - Date: DATE subtraction, TIMESTAMP to DATE truncation,
TO_DATEerror precedence,NEXT_DAY,TRUNC/ROUND,EXTRACT. - Query: fractional, NULL and negative
FETCHcounts;NEXTVALrepeated in one row;NEXTVALinWHERErejected as ORA-02287.
Scope and limitations
Each area in COMPATIBILITY.md is one of ✅ Supported, STDDEV precision, FETCH PERCENT, mixed TIMESTAMP/DATE subtraction, BYTE/Unicode/character-set-dependent functions, IGNORE NULLS, MEDIAN, PERCENTILE_CONT, KEEP (DENSE_RANK ...), RAW conversion, NLS-dependent conversion.
| Item | Target |
|---|---|
| Java | 17 or later |
| Oracle baseline | Oracle Database 18c XE |
| PostgreSQL | 16 supported, 17 primary, 18 compatibility check only; 15 and older not supported |
| Aurora PostgreSQL 16/17 | Supported through the plain SQL installer |
Verification
501 differential tests between Oracle 18c XE 18.4.0.0.0 and embedded PostgreSQL 17.10, and 672 Maven tests, all passing. Within the declared scope they compare values, row order, NULLs, errors, binds/OUT values, JDBC metadata, update counts, and post-DML state.
Downloads
orafit-jdbc-1.0.0.jar— JDBC driver and offline analyzer. pgJDBC is not bundled; provide it in your application.orafit-jdbc-1.0.0-runtime.tar.gz— SQL runtime:native/for self-managed PostgreSQL,plain/for managed services.SHA256SUMS— SHA-256 checksums for the two files above.
Also on Maven Central: io.github.ltslab:orafit-jdbc:1.0.0
Install / Upgrade
- Extract the runtime archive. Self-managed PostgreSQL: copy
native/to the extension directory and runCREATE EXTENSION orafit;. Managed PostgreSQL: runpsql -v ON_ERROR_STOP=1 -f orafit--1.0.0.sqlfromplain/. - Add
orafit-jdbc-1.0.0.jarand pgJDBC to the classpath. - Set
driver=io.github.orafit.jdbc.OrafitDriverandurl=jdbc:orafit://<host>:<port>/<database>.
Analyzer: java -jar orafit-jdbc-1.0.0.jar [--details] path/to/sql. License: MIT; the bundled JSqlParser is Apache-2.0 (see THIRD_PARTY_NOTICES.md).
Full Changelog: https://github.com/ltslab/orafit/commits/v1.0.0