SQL Converter · Oracle → PostgreSQL
Convert Oracle SQL to PostgreSQL
Migrating Oracle to PostgreSQL means swapping ROWNUM paging for LIMIT, NVL for COALESCE, SYSDATE for now(), and dropping the DUAL table. A mechanical formatter only re-indents — it won’t rewrite dialect-specific syntax. The AI converter in the app translates the query and the table below shows exactly what changes.
Oracle — source
PostgreSQL — converted
What changes from Oracle to PostgreSQL
| Oracle | PostgreSQL | Why |
|---|---|---|
| ROWNUM <= 20 | LIMIT 20 | Postgres has no ROWNUM; row limiting moves to a LIMIT clause. |
| NVL(x, 0) | COALESCE(x, 0) | NVL is Oracle-only; COALESCE is the SQL-standard equivalent. |
| SYSDATE - 30 | now() - INTERVAL '30 days' | Date arithmetic uses interval literals in Postgres. |
| FROM dual | (omitted) | Postgres allows SELECT with no FROM, so DUAL disappears. |