---
title: "Migrate Oracle to PostgreSQL in your browser"
description: "Migrate an Oracle database to PostgreSQL: convert a SQL Developer or SQLcl export into a script with the same tables, keys and data, and a report of every change."
canonical: https://intosql.com/oracle-to-postgresql
last_updated: 2026-10-15
---

# Migrate Oracle to PostgreSQL in your browser

Drop the .sql file SQL Developer's Database Export or SQLcl writes, with its tables and Insert statements, and download a script for PostgreSQL with the same tables, keys, indexes and data. Every value PostgreSQL can't hold as it is, and every object it doesn't carry, is listed in the report.

[Oracle to PostgreSQL migration guide](https://intosql.com/docs/migrations/oracle-to-postgresql)

[Oracle to PostgreSQL data types](https://intosql.com/docs/types/oracle-to-postgresql)

## What changes from Oracle to PostgreSQL

Each row is a rule the converter applies, with the report line it writes when the rule changes something in your data.

| In Oracle | In PostgreSQL | Report line |
| --- | --- | --- |
| BOOLEAN (23ai) | boolean |  |
| VARCHAR2(n BYTE|CHAR), NVARCHAR2(n), CHAR(n), NCHAR(n), CLOB, NCLOB, LONG | varchar(n) and text |  |
| NUMBER, NUMBER(p,s), FLOAT(b) | numeric(p,s), or bigint |  |
| DATE, TIMESTAMP(p) | timestamp(p) |  |
| TIMESTAMP(7) to TIMESTAMP(9) | six digits of a second, the seventh cut | `fraction_cut` |
| TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH LOCAL TIME ZONE | timestamptz, the same instants |  |
| JSON (21c), and CLOB holding JSON | jsonb |  |
| BLOB, RAW(n), LONG RAW | bytea |  |
| ROWID, UROWID, XMLTYPE, SDO_GEOMETRY | text, and xml for XMLTYPE | `type_replaced` |
| collations that ignore case (BINARY_CI) | exact comparison | `case_insensitive_collation` |
| identity columns, and a sequence a BEFORE INSERT trigger assigns | GENERATED BY DEFAULT AS IDENTITY, continuing after the highest id |  |
| CREATE SEQUENCE | CREATE SEQUENCE with the same options |  |
| virtual columns (GENERATED ALWAYS AS ... VIRTUAL) | generated columns, STORED | `virtual_as_stored` |
| virtual columns with functions IntoSQL doesn't write, and the || operator | a plain column | `generated_not_translated` |
| defaults with functions IntoSQL doesn't write (SYS_GUID(), ||) | no default | `default_not_translated` |
| CHECK constraints | translated |  |
| CHECK constraints with functions IntoSQL doesn't write | not created | `check_skipped` |
| CHECK constraints that are DISABLE or ENABLE NOVALIDATE | not created | `check_not_enforced` |
| function-based, bitmap and domain indexes | not created | `index_skipped` |
| foreign keys | foreign keys, after the rows |  |
| foreign keys to tables the export doesn't create, and DISABLE or NOVALIDATE ones | not created | `foreign_key_skipped` |
| partitioned tables | one table with every partition's rows | `partitions_dropped` |
| NOT NULL columns with values that become NULL | NOT NULL dropped | `not_null_relaxed` |
| views, synonyms, types, packages, procedures, functions and other triggers | listed in the report | `not_converted_objects` |
| exports without CREATE TABLE (data only) | types read from the values | `no_schema` |
| expressions in INSERT values other than the ones exports write | NULL | `expression_value` |
| types IntoSQL doesn't know, and object types | text | `unknown_type` |
| dates before year 1 and time zones given as region names | NULL | `date_out_of_range` |
| NaN and Infinity in BINARY_FLOAT and BINARY_DOUBLE | NaN and Infinity kept |  |
| NUL characters in text | removed | `nul_removed` |
| text that isn't valid in its encoding | the bad bytes as the replacement character | `invalid_utf8_replaced` |
| text decoded twice (Ã±) | copied as it is | `mojibake_suspected` |

## Load the script into PostgreSQL

The script creates the tables, copies the rows, then adds keys, indexes and foreign keys, so it loads fast and stops at the first error.

```shell
psql -v ON_ERROR_STOP=1 -d mydb -f oracle.postgresql.sql
```

Foreign keys are added as NOT VALID and then validated. If a row points to a row that doesn't exist, the script tells you which constraint, instead of failing half way.

For a large dump, create the database first and run the script with psql from the same machine as the server.

IntoSQL Pro loads the file straight into PostgreSQL from the desktop app or the command line, without writing a script.

## Dump Oracle for the best result

The converter reads what the dump holds. These options keep more of your data in it:

- In SQL Developer, choose Tools, Database Export, with DDL and the Insert data format. SQLcl writes the same with SET SQLFORMAT INSERT.
- Run ALTER SESSION SET NLS_DATE_FORMAT = 'SYYYY-MM-DD HH24:MI:SS' before exporting: the default format writes dates without their time or century.
- A .dmp file from exp or expdp is binary: import it into an Oracle database, Oracle Database Free in Docker for one, and export it with SQL Developer.

## What isn't converted

Views, packages, procedures, functions, triggers, types and synonyms are written in PL/SQL. They are listed in the report by name, never dropped silently, so you can rewrite them for PostgreSQL.

## Questions about Oracle to PostgreSQL

### Is my dump uploaded?

No. The converter runs in your browser and reads the dump from your disk in pieces, so it never leaves your computer. The desktop app and the command line convert on your computer too.

### How large can the dump be?

The converter never holds the whole dump in memory: it reads the file twice, by ranges, and writes the script as it goes. Multi-gigabyte dumps convert in the browser, in the desktop app and with the command line.

### Can I convert a .dmp file from exp or expdp?

Not directly: Data Pump and the original Export write a binary format only Oracle reads. Import it into any Oracle database, Oracle Database Free runs in Docker, and export it with SQL Developer's Database Export or SQLcl. The converter says so when it gets a .dmp file.

### Which Oracle versions can the export come from?

Exports from SQL Developer and SQLcl, with DBMS_METADATA's table definitions, from Oracle 11g on. Every test export comes from Oracle 21c and 23ai, in American, German and ISO sessions, and is compared with its source cell by cell.

### What happens to NUMBER, DATE and the other Oracle types?

NUMBER becomes numeric, or bigint when every value is a whole number; DATE becomes timestamp, keeping its time; CLOB text, BLOB and RAW bytea, BINARY_DOUBLE double precision with NaN and Infinity, and intervals interval.

### Are identity columns and sequences kept?

Yes. Identity columns stay identity columns and continue after the highest id, and so does a column a trigger fills from a sequence. Sequences continue from where the export says they reached.

### What about PL/SQL packages, procedures and triggers?

They are listed in the report by name and not converted, because each database writes them in its own language.

### Which PostgreSQL versions does the script load on?

PostgreSQL 13 to 18. The same script loads on each of them, stopping at the first error if anything goes wrong.

## From Oracle

- [Oracle to MySQL](https://intosql.com/oracle-to-mysql)
- [Oracle to MariaDB](https://intosql.com/oracle-to-mariadb)
- [Oracle to SQLite](https://intosql.com/oracle-to-sqlite)
- [Oracle to SQL Server](https://intosql.com/oracle-to-sql-server)
- [Oracle to Oracle](https://intosql.com/oracle-to-oracle)

## Into PostgreSQL

- [MySQL to PostgreSQL](https://intosql.com/mysql-to-postgresql)
- [MariaDB to PostgreSQL](https://intosql.com/mariadb-to-postgresql)
- [PostgreSQL to PostgreSQL](https://intosql.com/postgresql-to-postgresql)
- [SQL Server to PostgreSQL](https://intosql.com/sql-server-to-postgresql)
- [SQLite to PostgreSQL](https://intosql.com/sqlite-to-postgresql)

## Guide and every pair

- [PostgreSQL to Oracle](https://intosql.com/postgresql-to-oracle)
- [Oracle to PostgreSQL migration guide](https://intosql.com/docs/migrations/oracle-to-postgresql)
- [Oracle to PostgreSQL data types](https://intosql.com/docs/types/oracle-to-postgresql)
- [Every database pair](https://intosql.com/database-migration)
