Modernize

Move your database logic to PostgreSQL

SQL Tran’s deterministic engine translates your Oracle or SQL Server schema and stored code. Logic Proof runs the translation alongside the original. Before cutover, you can see which procedures write the same rows, which functions give a different answer, and which objects still need an implementation.

SQL Server to PostgreSQL

What passed in the first sales schema translation?

  • Sales object
    BigCustomers
    Behavior under test
    Customers with a credit limit over 5,000
    Verdict
    Passed
  • Sales object
    OrderCount
    Behavior under test
    Order count for a given customer
    Verdict
    Passed
  • Sales object
    CustomerCount
    Behavior under test
    Qualifying customer count in an output parameter
    Verdict
    Passed
  • Sales object
    Weekday
    Behavior under test
    Weekday number calculated from a date
    Verdict
    Failed

Selected objects from the sales integration test. The verdicts apply to the first translation and the cases exercised on it.

Why the weekday calculation failed

The sales function counts days since Monday, January 1, 1900, then takes the remainder after division by seven. Its first translation applies the remainder operator to a date, which PostgreSQL rejects. Subtracting the dates first produces an integer day count. The corrected function passes verification in the next revision.

SQL Server expression
DATEDIFF(DAY, '19000101', @day) % 7
PostgreSQL expression, using day as the date parameter
(day - DATE '1900-01-01') % 7
Explore Oracle to PostgreSQL translation

Choose how the code will run on PostgreSQL

Start with a source script or let SQL Tran read the definitions through a database connection. SQL Server projects target idiomatic PostgreSQL. Oracle projects can also use pgSqlTranOra, the SQL Tran extension that implements Oracle packages and functions. That choice requires a PostgreSQL host that allows the extension and a superuser to install it.

Decide where to translate dynamic SQL

An Oracle procedure may build a query only when it runs. With runtime translation enabled, PostgreSQL sends supported dynamic SQL to SQL Tran for translation, then executes it with its bind values. PostgreSQL must be able to reach SQL Tran during testing and after deployment. With the option off, routines that need runtime translation go to repair.

Test the first translation on both engines

Logic Proof captures the translation as revision 1 and applies it to the project automatically. A verification run builds the objects in dedicated source and target test databases, loads one set of generated rows into both, and exercises the code with matching inputs. Open an object to see its creation result, the cases that ran, and where the two sides differed.

Keep the release scripts tied to the test run

If an engineer edits a routine in SQL Tran after a revision is applied, the next run names the changed object. Capture the edit as a new revision or reapply the earlier code. The delivery package pairs the applied revision’s PostgreSQL scripts, ordered by dependency, with a readable report and machine-readable test evidence.

Decisions to make before the first run

What should we check before choosing an Oracle runtime?

Start with two facts about your estate. Which Oracle packages and functions does your code use? Which extensions will your PostgreSQL host let you install? The SQL Tran Oracle compatibility extension implements Oracle behavior on the target and requires installation privileges. Idiomatic PostgreSQL is the other runtime choice.

Review dynamic SQL separately. A procedure that builds its query at execution time may depend on a connection back to SQL Tran after deployment. Include that dependency in your target architecture if you enable runtime translation.

Which source objects need a PostgreSQL implementation of their own?

A source object can map to several target statements, or its behavior can move into another object. For example, a PostgreSQL array can replace an Oracle collection type. Logic Proof marks the standalone type as skipped when the translation deliberately creates nothing for it. Look to the routines that use the type to test its behavior.

A missing translation needs a different decision. Inspect the source definition, the translator’s reason, and any partial PostgreSQL code before sending the object to repair.

What happens when an engineer edits the translation?

The first translation becomes revision 1 automatically. Later edits in the SQL Tran workspace become another revision when you take a snapshot. If the applied revision and the workspace SQL differ, Logic Proof names the changed objects and stops the run.

Take a snapshot to test your edit, or reapply the earlier revision to reproduce its behavior. That gives an engineer investigating a regression a specific implementation to reproduce.

What does your team need to verify?

Tell us which database you’re moving, how far the PostgreSQL code has come, and which behaviors matter most at cutover.

Cookie settings

Choose what Spectral Core can use on this browser. You can change your choices at any time.

Essential storageRemembers your privacy choices.
Always on