Home › Insights › Blogs › App Modernization

Oracle vs PostgreSQL: The Differences That Matter Before You Migrate

Parikshit Talesara Parikshit Talesara
Last updated: 27 Nov 2026
Get an AI summary of this post on Perplexity ChatGPT Gemini
Key takeaways
The real difference is the licence model, not the feature list. PostgreSQL covers in core, or through free extensions, much of what Oracle prices as separate options.
Both use MVCC, but Oracle keeps old row versions in an undo tablespace and PostgreSQL keeps them in the table until VACUUM clears them. Most PostgreSQL operational surprises trace back to that.
Oracle is genuinely stronger in one place that matters: Real Application Clusters has no PostgreSQL equivalent.
Neither is faster in general. Which wins on a given workload depends on the workload, and anyone quoting a figure without naming the benchmark is quoting a different system.

Oracle Database is commercial software licensed per processor or per named user. PostgreSQL is open source under a permissive licence with no fee. Nearly everything else people argue about follows from that one fact, including several differences that look technical and are really commercial. Which is right for a given system comes down to three things: what the licence is costing you, whether anything depends on a feature with no equivalent, and how much Oracle-specific code sits on top. This comparison is for the decision before the project, and it pairs with our wider modernization strategy guidance.

Oracle vs PostgreSQL at a glance

Ten differences that change a decision, rather than every difference that exists. Note how many of the rows are about packaging rather than capability, because that is the pattern underneath the whole comparison.

Oracle Database and PostgreSQL compared.
DimensionOracle DatabasePostgreSQL
Licence modelCommercial; per processor or Named User Plus with minimumsPostgreSQL License, permissive open source, no fee
Priced optionsPartitioning, Advanced Security, RAC and others licensed separatelyIn core, or free extensions
Procedural languagePL/SQLPL/pgSQL, plus Python, Perl and others
PackagesYes, with package-level stateNo package object; a schema of functions instead
Old row versionsUndo tablespaceIn the table, reclaimed by VACUUM
Transactional DDLNo; DDL commits implicitlyYes; DDL can be rolled back
ConnectionsDedicated or shared serverOne process per connection; pooler required
High availabilityData Guard, Active Data GuardStreaming and logical replication, read replicas
Shared-storage clusteringReal Application ClustersNo equivalent
ExtensibilityFixed feature set with licensed optionsExtensions: PostGIS, pgvector, TimescaleDB and others

Licensing and cost

Oracle Database is licensed either per processor, where the count is derived from physical cores multiplied by a core factor that depends on the processor, or by Named User Plus, which carries a minimum number of users per processor whether or not you have that many people. Features are not all included: Partitioning, Advanced Security, Advanced Compression, Real Application Clusters and others are priced as separate options on top of the edition. Annual support is charged as a percentage of the licence fee and rises over time. Figures change, so take them from Oracle’s current price list rather than from any article, including this one.

PostgreSQL has no equivalent column. The project describes its licence as “a liberal Open Source license, similar to the BSD or MIT licenses”. There is no fee, no core factor, no user minimum, and no separate charge for partitioning, encryption or replication.

What this does not mean is that PostgreSQL is free to run. The money moves rather than disappearing: to a support contract if you want one, to managed hosting if you do not want to run it yourself, and to the engineering time that any database needs. The honest framing is that PostgreSQL removes a licence line that scales with your hardware and replaces it with costs that scale with your choices, which is a different shape of spend rather than the absence of spend.

See how much you could save by moving off Oracle.

Send us your edition, the options you are licensed for and your processor count, and we will put a number against what the same workload looks like on PostgreSQL, alongside what it would take to get there.

Get a Free Oracle Migration Assessment

Architecture: MVCC, undo and connections

Both databases give readers a consistent view without blocking writers, and both do it with multi-version concurrency control. Where they differ is where the previous version of a row is kept, and that single choice explains most of what surprises an Oracle team running PostgreSQL for the first time.

Where Oracle and PostgreSQL keep the previous version of an updated row Oracle keeps the current row version in the table and writes the previous version to a separate undo tablespace, which readers follow to reconstruct an older view. PostgreSQL writes a new row version into the table alongside the old one, which stays there as a dead row until VACUUM reclaims the space. Oracle Table Row, current version Undo tablespace Previous versions Old versions come from undo PostgreSQL Table Row v2, live Row v1, dead VACUUM reclaims dead rows Old versions stay until VACUUM runs Where Oracle and PostgreSQL keep the previous version of an updated row Oracle keeps the current row version in the table and writes the previous version to a separate undo tablespace, which readers follow to reconstruct an older view. PostgreSQL writes a new row version into the table alongside the old one, which stays there as a dead row until VACUUM reclaims the space. Oracle Table Row, current version Undo tablespace Previous versions Old versions come from undo PostgreSQL Table Row v2, live Row v1, dead VACUUM reclaims dead rows Old versions stay until VACUUM
One difference, and most of what surprises an Oracle team follows from it: table bloat, autovacuum tuning, and why a heavily updated table grows slower to scan rather than staying the same size.

Oracle writes the old version to an undo tablespace, so the table holds only current rows and a reader needing an older view reconstructs it from undo. PostgreSQL writes a new version into the table and marks the old one dead, where it stays until VACUUM reclaims the space. The consequence is that a heavily updated PostgreSQL table grows, and a bloated table is slower to scan in proportion to the dead space it carries. Autovacuum handles this unattended for most workloads and needs attention for the tables your batch jobs rewrite, which are rarely the tables anyone thought to monitor.

PostgreSQL runs DDL inside transactions. You can begin a transaction, alter several tables, hit an error and roll the whole thing back. Oracle commits DDL implicitly, so a schema migration that fails halfway leaves partial changes behind. This is a genuine PostgreSQL advantage and it is rarely on comparison tables, because it only becomes obvious the first time a deployment script fails cleanly instead of messily.

Connections are a resource decision. PostgreSQL forks a backend process per connection, where Oracle’s shared server mode lets a large pool sit against a modest server. An application pool sized against Oracle will exhaust PostgreSQL well before the hardware is busy, so a pooler such as PgBouncer is part of the architecture rather than a tuning step applied later.

SQL and procedural language

Both implement the SQL standard well, and PostgreSQL has historically been the stricter of the two about following it. Day-to-day SQL moves between them with little friction. The procedural layer is where the distance shows.

PL/pgSQL was designed to resemble PL/SQL, so declarations, cursors, loops, %TYPE and exception blocks all look familiar. It is a different language, nothing runs unchanged, and the resemblance makes the first stretch of a conversion feel faster than the whole will be. Packages are the structural gap: PostgreSQL has no package object, so a package becomes a schema of functions, and package-level variables have to be rehoused somewhere else entirely.

Oracle-specific SQL in the applications is the part that gets underestimated, because it is spread across every repository rather than concentrated in one schema. NVL, DECODE, ROWNUM, (+) outer joins, MINUS, SYSDATE and CONNECT BY all have PostgreSQL answers, and two of them compute something different from the original. For how Oracle code converts, construct by construct, see the conversion guide.

High availability and scaling

Oracle’s answer is Data Guard, with Active Data Guard adding readable standbys. PostgreSQL’s is streaming replication with read replicas, logical replication for selective and cross-version cases, and mature automated failover tooling around both. For the common requirement, a hot standby that takes over on failure and replicas that absorb read traffic, the two are comparable and PostgreSQL is not the weaker option.

Real Application Clusters is the exception, and it is worth stating plainly rather than talking around. RAC runs multiple instances against a single shared database, all active and writable at once, which scales writes across nodes and survives the loss of a node without failover. PostgreSQL has nothing equivalent. Its own documentation describes shared disk failover as having “only one copy of the database” with a single active server, which is a different thing: high availability, not active-active scaling.

In practice far fewer systems depend on RAC than are licensed for it, and some that do are using it for availability rather than write scaling, which PostgreSQL covers. Establishing which of the two you are actually relying on is one of the more valuable hours in an assessment.

Performance

Neither database is faster than the other in general, and comparisons claiming otherwise are usually measuring a configuration rather than a product. Oracle has had decades of investment in its optimizer and in features such as parallel query. PostgreSQL has a strong planner, indexing that covers more access patterns than most teams use, and an extension ecosystem that adds specialised performance where it is needed.

What is true and useful is that performance after a migration is decided mostly by things other than the engine. A freshly loaded PostgreSQL database has no statistics until ANALYZE runs, and plans built on defaults will send you investigating the wrong query. Oracle optimizer hints are dropped in conversion, because PostgreSQL has no native equivalent. The connection pool carried over from Oracle will be wrong. Each of those is addressable, and each has been reported as “PostgreSQL is slower” more than once.

We have not put numbers in this section deliberately. A benchmark without the schema, the data distribution, the hardware and the configuration behind it is not evidence, and the published comparisons that do include those details are usually measuring a workload that is not yours.

Can PostgreSQL replace Oracle?

For most systems, yes. The question worth asking is not whether PostgreSQL is capable, it is whether anything in your specific estate depends on something with no equivalent.

PostgreSQL is a straightforward replacement when the workload is ordinary OLTP or mixed reporting; high availability means a standby and read replicas rather than active-active writes; the Oracle-specific code is moderate in volume; and the licensed options in use are Partitioning, compression or encryption, all of which PostgreSQL covers in core or by extension.

Think harder when the system depends on RAC for write scaling rather than for availability; a certified packaged application is involved and the vendor supports Oracle only; there is a very large body of PL/SQL with heavy package state; or the system has a short remaining life, where the licence saving may not repay the engineering before it is retired.

That last one is the case teams argue themselves out of least often and should consider most. A database with three years left and a modest licence is rarely worth a migration, and saying so early is more useful than a business case built to reach a predetermined answer. Where the answer is yes, the step-by-step migration guide sets out what the work involves. For a data centre exit that forced the decision, and what choosing PostgreSQL cost and saved in practice, see the case study. The assessment that establishes which column you are in is the same one behind our Oracle to PostgreSQL migration services.

Planning an Oracle to PostgreSQL migration?

Tell us the Oracle version, roughly how large the database is and where you want to land. You will talk to a database architect, not an account manager.

Talk to a Database Architect
#oracle vs postgresql #postgresql vs oracle differences #can postgresql replace oracle #oracle vs postgresql performance #oracle vs postgresql license cost #oracle postgresql compatibility
Share

Frequently asked questions

Is PostgreSQL as secure as Oracle?
For most workloads, yes. PostgreSQL provides role-based access control, row-level security, TLS, SCRAM authentication, integration with Kerberos and LDAP, and auditing through extensions such as pgaudit. The difference is packaging rather than capability: several controls Oracle sells as licensed options are either built into PostgreSQL or supplied by extensions, and they need configuring rather than purchasing.
Does PostgreSQL have an equivalent to Oracle RAC?
No, and it is worth being plain about that. Real Application Clusters runs multiple instances against one shared database, active and writable at the same time. PostgreSQL offers streaming replication with read replicas, and shared-disk failover where a single server is active at a time. Both give high availability. Neither gives active-active scaling across one copy of the data.
Is PostgreSQL free for commercial use?
Yes. PostgreSQL is released under the PostgreSQL License, which the project describes as a liberal open source licence similar to the BSD or MIT licences. There is no fee, no per-core charge and no user minimum. Commercial spend on PostgreSQL goes to support contracts, managed hosting or tooling, all of which are optional and separable.
Parikshit Talesara
CEO, Kansoft

CEO and co-founder of Kansoft, with 22 years leading enterprise software engineering, application modernization, and product engineering programs across global delivery teams.

Need help with your next project?

Our engineering experts can help you build something exceptional.

Book a Free Call