Pick PostgreSQL when you want a fully open, community-run database with deep extension support, JSON tools and custom data types, and pick MySQL when you want the familiar relational database that Oracle develops and supports, with paid editions and a managed cloud service from the same company. Both are free to download. The big practical difference is the licence: PostgreSQL uses a liberal licence similar to BSD or MIT, while MySQL uses the GPL, and Oracle sells a commercial licence if you need to embed it in a product you sell.
Developers argue about this pair endlessly, so I went to the source instead of the forums. I read the PostgreSQL about, licence and versioning pages and the MySQL 8.4 reference manual, Community Edition and product pages, and here's what each project says about itself.
PostgreSQL and MySQL side by side
| PostgreSQL | MySQL | |
|---|---|---|
| Who's behind it | The PostgreSQL Global Development Group | Oracle Corporation develops, distributes and supports it |
| Licence | PostgreSQL License, similar to BSD or MIT | GPL, with a commercial licence on sale |
| Type | Object-relational database | Relational database |
| Free option | The whole project is free and open source | Community Edition, freely downloadable |
| Paid layer | Support and hosting from third parties | Enterprise, Standard and Classic editions plus HeatWave |
| Release rhythm | One major version about once a year, each supported for 5 years | Not set out on the pages I read |
| Origins | POSTGRES project at the University of California, Berkeley, in 1986 | Described in its manual as the most popular open source SQL database |
The licence detail that matters if you build software to sell
This is the part most quick comparisons skip. The MySQL manual says plainly that MySQL uses the GPL to define what you can and can't do, and that if you feel uncomfortable with the GPL or need to embed MySQL code in a commercial application, you can buy a commercially licensed version from Oracle. PostgreSQL's licence page describes its own licence as a liberal open source licence, similar to the BSD or MIT licences, which places far fewer conditions on how you ship it.
For a business running its own website or app on a server, either licence is usually fine. It's software companies that bundle the database inside a product they distribute who need to read the terms carefully, and that's where PostgreSQL's simpler licence often settles the debate.
Where PostgreSQL pulls ahead on features
PostgreSQL's about page reads like a feature catalogue. It has been ACID compliant since 2001, it supports JSON and JSONB documents, XML, key-value storage through hstore, arrays, ranges and UUIDs, and it lets you define your own data types and functions. You can write stored procedures in PL/pgSQL, Perl, Python or Tcl, with more languages available through extensions, and foreign data wrappers let it query other databases through standard SQL. Add the popular PostGIS extension and it handles geospatial data too.
If your data is documents rather than tables, our MongoDB vs PostgreSQL guide is worth a look.
Where MySQL makes life simple
MySQL's strength is its familiarity and its single owner. The manual describes a multithreaded client and server system with a wide range of client libraries and tools, and it can also run as an embedded library inside an application. Oracle offers a clear upgrade path from the free Community Edition, which includes SQL and NoSQL features, to Enterprise Edition, a cluster edition and MySQL HeatWave, a cloud service that combines transactions with analytics and machine learning.
MySQL also has a close cousin, and our MariaDB vs MySQL guide explains the differences.
How to choose in five questions
- Will you embed the database inside software you sell? Read the MySQL GPL terms first, or choose PostgreSQL.
- Do you need geospatial data, custom types or heavy JSON queries? PostgreSQL's extensions cover those well.
- Does your hosting provider or app framework assume MySQL? Going with the default saves setup time.
- Do you want one vendor to call for support and a managed cloud? MySQL's Oracle editions give you that.
- How long will the system run untouched? PostgreSQL publishes a five-year support window for each major version.
If you're weighing the bigger picture first, my piece on why choosing a good database matters for your business is a good starting point, and these ChatGPT prompts for SQL help whichever one you pick.
Want AI doing the heavy lifting in your marketing?
I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.
My advice on MySQL or PostgreSQL
For a new project with no legacy constraints, I'd start with PostgreSQL. Its licence is simpler, its feature set is wide, and its release and support schedule is published in plain terms. Choose MySQL when your platform, hosting or team already runs on it, or when you want Oracle's editions and HeatWave service behind you. Neither choice is a mistake for a small business website or app; the mistake is switching halfway through, so decide based on the tools you already use.
Do you make database tools? Tool makers can ask to be considered for a featured place in comparisons like this one.
Frequently asked questions
Is PostgreSQL free for commercial use?
Yes. PostgreSQL is released under the PostgreSQL License, a liberal open source licence that its project describes as similar to the BSD or MIT licences.
Is MySQL free?
MySQL Community Edition is freely downloadable under the GPL. Oracle sells Enterprise, Standard and Classic editions, and a commercial licence for embedding MySQL in commercial applications.
Who owns MySQL?
The MySQL reference manual says MySQL is developed, distributed and supported by Oracle Corporation.
Which version of PostgreSQL is current?
The PostgreSQL documentation lists version 18 as current, with versions 14 to 18 supported. Each major version is supported for five years after its first release.
Does PostgreSQL support JSON?
Yes. PostgreSQL lists JSON and JSONB data types, SQL/JSON constructors, path expressions and JSON_TABLE among its features.