Quick Table of Contents
Migrating from PostgreSQL
1. Dump the database
pg_dump -d -O
-d, --inserts dump data as INSERT, rather than COPY, commands
-O, --no-owner skip restoration of object ownership
in plain text format
2. Fix the dump
Remove lines
Remove lines beginning with SET.
Remove lines beginning with COMMENT.
Remove CREATE FUNCTION lines.
Remove CREATE TRUSTED lines.
Fix syntax
Fix the create sequence syntax.
Fix datatypes
date columns, with and without timezones. You may also need to change the NLS_TIMESTAMP_FORMAT by adding
alter session set NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF';
to your script. There is also a NLS_DATE_FORMAT
Change text columns to CLOBs.
Change bytea columns to BLOBs.
Change boolean columns to Integer 0,1
Fix object name lengths
Oracle's maximum is only 30 chars.

