On this page
Short answer
Choose PostgreSQL for complex queries, JSONB-heavy data, geospatial or vector search through extensions such as PostGIS and pgvector, and a permissive license with no commercial edition. Choose MySQL when the application, framework or team already runs on it, when you want built-in group replication with automatic primary election through InnoDB Cluster, or when you want a vendor-backed commercial license from Oracle. Both handle typical transactional workloads well, and the performance difference that matters is usually your schema and queries, not the engine. Check the version you run first: MySQL 8.0 reached end of life on 21 April 2026, and PostgreSQL 14 reaches it on 12 November 2026.
PostgreSQL vs MySQL on the same criteria
| PostgreSQL | MySQL | |
|---|---|---|
| License | PostgreSQL License, a permissive license similar to BSD or MIT | GPLv2 for the Community Edition, or a commercial license from Oracle (dual licensing) |
| Who ships it | PostgreSQL Global Development Group | Oracle |
| JSON | <code>json</code> (exact text) and <code>jsonb</code> (decomposed binary, indexable) | <code>JSON</code> type in a binary format; indexed through generated columns or multi-valued indexes |
| CTEs and window functions | Supported | Supported since MySQL 8.0 |
| Extensions | Loaded with <code>CREATE EXTENSION</code>: PostGIS, pgvector and many more | Plugins and components; no equivalent extension ecosystem |
| MVCC | Old row versions stay in the table until <code>VACUUM</code> reclaims them | InnoDB keeps old versions in undo logs and purges them |
| Built-in replication | Streaming (physical WAL) and logical replication | Binary log replication; Group Replication and InnoDB Cluster |
| Managed cloud | RDS, Aurora, Cloud SQL, Azure Database for PostgreSQL | RDS, Aurora, Cloud SQL, Azure Database for MySQL |
| Version support | 5 years per major version | LTS: 5 years Premier plus 3 years Extended; Innovation: until the next Innovation release |
| Wins when | Complex SQL, JSONB, geospatial, vector, permissive license | Existing MySQL estate or stack, built-in group replication, Oracle as vendor of record |
Licensing: PostgreSQL License vs GPL and Oracle's dual license
PostgreSQL is released under the PostgreSQL License, which the project describes as a liberal open source license similar to BSD or MIT. There is no commercial edition of PostgreSQL itself; companies sell distributions, managed services and support around it.
Oracle offers the MySQL server and client libraries under a dual license: GPLv2, or a commercial license. Oracle's guidance is that OEMs, ISVs and VARs that embed MySQL in software they distribute, and do not want to release their own source under the GPL, should buy the commercial license. For a company that runs MySQL internally behind its own applications, the GPL rarely changes anything in practice. It matters when you ship MySQL inside a product.
SQL features: JSON, CTEs, window functions and extensions
JSON. PostgreSQL has two types. json stores an exact copy of the input text and reparses it on each use; jsonb stores a decomposed binary form that is slightly slower to write, significantly faster to process, and supports indexing. MySQL's JSON type also uses a binary format with direct lookup by key or array index. MySQL does not index JSON columns directly: you index a generated column that extracts a value, or use a multi-valued index on a JSON array.
CTEs and window functions. MySQL 8.0 added common table expressions, including recursive ones, and window functions such as RANK(), LAG() and NTILE(). On 8.0 or later, the old gap for analytical SQL has largely closed. On 5.7 it has not.
Extensions. This is the widest gap. A PostgreSQL extension packages new types, functions, operators and index methods, and loads with one CREATE EXTENSION command. PostGIS adds storage, indexing and querying of geospatial data. pgvector adds vector similarity search with HNSW and IVFFlat indexes. MySQL's current reference manual documents a VECTOR type, but there is nothing comparable to the breadth of the PostgreSQL extension ecosystem.
Concurrency and performance trade-offs
Both engines use multiversion concurrency control, so readers do not block writers. They store old versions in different places, and that shapes how each behaves under load.
In PostgreSQL an UPDATE or DELETE does not immediately remove the old row version; VACUUM, usually run by autovacuum, reclaims the space and keeps planner statistics current. Update-heavy tables need autovacuum tuned, or they grow and slow down. InnoDB keeps old row versions in undo tablespaces and removes them in a background purge. Each InnoDB table stores its rows in a clustered index, typically the primary key, and every secondary index carries the primary key columns, so primary key choice affects InnoDB more directly.
Published benchmarks rarely transfer to a real workload, so we do not quote them. Test your own schema, queries and concurrency on both before deciding on performance grounds.
Replication and high availability
PostgreSQL ships two replication methods. Streaming replication sends write-ahead log records to standby servers as they are generated. Logical replication uses publications and subscriptions, can replicate selected tables, and works between different major versions, which makes it a common upgrade path. Automatic failover comes from outside tools such as Patroni or repmgr.
MySQL replicates through the binary log. Group Replication adds a single-primary mode with automatic primary election, or a multi-primary mode. InnoDB Cluster wraps it with MySQL Shell and MySQL Router so applications reconnect after a failover without custom code. The MariaDB fork offers Galera Cluster, a virtually synchronous multi-primary cluster, which is a different product from Oracle's MySQL.
Managed offerings on AWS, Google Cloud and Azure
Every large cloud runs both. Amazon RDS supports MySQL and PostgreSQL, and Aurora is compatible with both. Google Cloud SQL runs MySQL, PostgreSQL and SQL Server. Azure offers Azure Database for MySQL flexible server and Azure Database for PostgreSQL. All four keep an end-of-life version running for a fee for a period and then upgrade it for you; the dates are in the end-of-life guides linked below.
Support lifecycles: PostgreSQL vs MySQL
The PostgreSQL Global Development Group supports each major version for five years, then ships a final minor release. PostgreSQL 14 reaches end of life on 12 November 2026 and PostgreSQL 15 on 11 November 2027.
MySQL now ships on two tracks. LTS releases, such as 8.4 and 9.7, follow Oracle's Lifetime Support policy of five years of Premier Support and three years of Extended Support. Innovation releases are supported only until the next Innovation release. MySQL 8.0 moved to Sustaining Support on 21 April 2026 and MySQL 5.7 on 25 October 2023; Oracle recommends 8.4 LTS or 9.7 LTS.
If an upgrade cannot happen this quarter, OSSeva, AceMQ's extended support platform, ships patched builds for PostgreSQL 11 to 13, for 14 once its community support ends, and for MySQL 5.7 and 8.0.
When to choose PostgreSQL, and when MySQL
- PostgreSQL for new applications with complex queries, reporting on transactional data, JSONB documents, geospatial data, vector search next to relational data, or a legal preference for a permissive license.
- MySQL when the application stack expects it, when the team's operational knowledge is in MySQL, when you need Oracle as the vendor of record, or when an existing replication topology already works.
- Neither by default. Moving a working estate between them is a project measured in testing effort, so it needs a reason beyond preference.
Migrating from MySQL to PostgreSQL
pgloader is the usual starting tool: one command reads a MySQL database, converts the schema, builds indexes and loads the data, applying default casting rules you can override. Its rules cover MySQL-specific types, for example converting zero dates to NULL and handling unsigned integer columns.
The data move is rarely the hard part. The application is: SQL written for MySQL's dialect, identifier quoting, case and collation behavior, upsert syntax and stored procedures all need review and testing. Run the migration against a copy of production, compare query results and plans, then cut over during a short write freeze, or keep the target in sync with change data capture until the switch.
Support for both under one contract
AceMQ supports both engines on any version, self-managed or cloud-hosted: see PostgreSQL support, MySQL support, or database support for one contract across both.
Frequently asked questions
Is PostgreSQL better than MySQL?
Not in general. PostgreSQL has the richer SQL feature set and extension ecosystem, and a permissive license. MySQL is simpler for teams and stacks already built on it, and has built-in group replication with automatic primary election. Choose on your workload and team, and test performance on your own schema.
Is MySQL free for commercial use?
The Community Edition is available under GPLv2 and can be used commercially. Oracle requires a commercial license when an OEM, ISV or VAR distributes MySQL inside its own software and does not want to release that software's source under the GPL.
Does MySQL support JSON like PostgreSQL's JSONB?
MySQL has a JSON type stored in a binary format with fast lookup by key. It cannot index a JSON column directly; you index a generated column or use a multi-valued index. PostgreSQL's jsonb can be indexed directly.
When is MySQL 8.0 end of life?
MySQL 8.0 moved to Oracle Sustaining Support on 21 April 2026, so it no longer receives new fixes. Oracle recommends upgrading to MySQL 8.4 LTS or 9.7 LTS.
How long is a PostgreSQL version supported?
Five years from its first release. PostgreSQL 14 reaches end of life on 12 November 2026 and PostgreSQL 15 on 11 November 2027.
How do I migrate from MySQL to PostgreSQL?
Start with pgloader, which converts the schema and loads the data in one command, then review application SQL, data types and collations, test against a copy of production, and cut over during a short write freeze or with change data capture keeping the target in sync.
Related
Where this gets done
The work behind this page, run by the same engineers who wrote it.
Other Support guides, comparisons and research
Talk to an engineer
AceMQ supports 130+ enterprise clients in 26+ countries. Tell us what you are running and we will come back within a business day.