top of page

Oracle to PostgreSQL: Where the Time Really Goes

OmerNarman
Aug 9
3 min read

Updated: Oct 24

Moving the data from Oracle to PostgreSQL is the quick part of the project. Tools exist for it, it can be rehearsed, and the final cutover can run through logical replication with almost no downtime. The months go elsewhere: into the procedural code, into the assumptions the application makes about the database, and into the operating habits of the team that will run the result.


The schema converts in days; the code takes months

Tables, constraints and most indexes convert mechanically. Data types need attention but follow rules: NUMBER maps to numeric or an integer type depending on precision, DATE carries a time component that the PostgreSQL date type does not, and VARCHAR2 treats an empty string as NULL where PostgreSQL does not.

PL/SQL is a different matter. Packages, procedures, triggers and functions have to be rewritten in PL/pgSQL, and conversion tools get you part of the way. The pieces that take human time are predictable:

  • Package state, autonomous transactions and exception-handling patterns that have no direct equivalent.

  • Oracle-specific SQL: CONNECT BY hierarchies, the (+) outer join syntax, DECODE, NVL, ROWNUM and MERGE behaviour.

  • Bulk operations and cursor patterns written for the Oracle optimizer that run slowly on PostgreSQL until rewritten.

  • Sequences, identity columns and triggers that emulated features PostgreSQL provides natively.

The honest estimate comes from counting: lines of PL/SQL, number of packages, and how much of the business logic lives in the database rather than in the application.


The application has opinions

Applications written against Oracle carry assumptions that only surface on another engine. Identifier case handling differs. Empty strings and NULL behave differently. Implicit conversions that Oracle tolerated become errors. Date arithmetic, string functions and pagination idioms change. Drivers and connection pools change, and the SQL generated by an ORM may need review.

Each of these is small. Together they are why the test phase is as long as the conversion phase, and why a migration with a thin test suite always runs late.


Operations change too

The team that ran Oracle inherits a platform with different tools. Backups are base backups and WAL archives. Replication is streaming or logical, with failover handled by tooling around the database rather than inside it. Vacuum and bloat management become a daily concern. Connection pooling is usually mandatory rather than optional. Monitoring, alerting and patching all need new runbooks.

None of this is harder than Oracle. It is different, and the time to learn it has to be in the plan.


A plan that reflects where the effort goes

  1. Inventory and estimate: object counts, PL/SQL volume, application touchpoints and data volume, turned into an effort estimate per area.

  2. Automated conversion for the schema and the bulk of the code, with every unconverted object logged.

  3. Manual rework of the remaining code, prioritised by what the application calls most.

  4. A test harness that compares results between the two databases for the same inputs.

  5. Data migration with validation: an initial load, then logical replication or GoldenGate to keep the target in step until cutover.

  6. Performance tuning on PostgreSQL against a production-like load, because execution plans will differ.

  7. A parallel run where the budget allows, and a rollback path that stays open until sign-off.


The rule of thumb

If the database holds little procedural code, the migration is a data and testing exercise and can be measured in weeks. If it holds the business logic, plan in months, put the majority of the effort into code rework and testing, and treat the data move as the last and smallest step.


Soro Consulting delivers Oracle to PostgreSQL migrations end to end, from the first inventory to the operating runbooks. Book a consultation to get a realistic estimate for your estate.

Recent Posts

See All

Comments


bottom of page