Is PostgreSQL Open Source? License, Features and When to Use It
Yes, PostgreSQL is fully open source. It is released under the PostgreSQL License, a short permissive license similar to the MIT and BSD licenses. You can use it for free in commercial products, modify it, and redistribute it, without paying fees or publishing your own source code. There is no paid “enterprise edition” of PostgreSQL itself; every feature is in the free version.
This article explains what the license allows, who develops PostgreSQL, what it is good at, and when you might choose something else.
What the PostgreSQL License allows
The license is only a few paragraphs long. In practice it means:
- Free for any use, including commercial and closed-source software.
- You may modify and redistribute PostgreSQL, even as part of a paid product.
- No copyleft. Unlike GPL-licensed software, you do not have to release your changes.
- The only condition is keeping the copyright notice and license text in copies of the software.
This is why many companies build commercial databases and cloud services on top of PostgreSQL (for example Amazon Aurora PostgreSQL, Azure Database for PostgreSQL, Google Cloud SQL and AlloyDB, Supabase and Neon). They can sell services around it because the license allows it.
Who owns and develops PostgreSQL?
No single company owns PostgreSQL. It is developed by the PostgreSQL Global Development Group, a community of contributors from many companies and individuals. The project started at the University of California, Berkeley in 1986 (as POSTGRES) and has been open source since 1996.
A new major version is released roughly once a year, and each major version receives bug and security fixes for five years. Because no vendor controls the project, there is no risk of a sudden license change, which has happened to other popular databases.
PostgreSQL vs other databases: license comparison
| Database | License | Notes |
|---|---|---|
| PostgreSQL | PostgreSQL License (permissive) | Everything free, no commercial edition |
| MySQL | GPLv2 or commercial (Oracle) | Some enterprise features are paid |
| MariaDB Server | GPLv2 | Community fork of MySQL |
| SQLite | Public domain | Embedded, not a server |
| SQL Server | Proprietary (Microsoft) | Free Express/Developer editions with limits |
| Oracle Database | Proprietary | Free edition with limits |
What PostgreSQL is good at
PostgreSQL is a relational, ACID-compliant database, but it goes well beyond plain tables.
Standards-compliant SQL. Window functions, common table expressions (CTEs), LATERAL joins, MERGE, and full transactional DDL (you can roll back an ALTER TABLE).
JSON support. The jsonb type stores JSON in a binary, indexable format. You can mix relational and document data in the same table:
CREATE TABLE orders (
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
customer text NOT NULL,
details jsonb NOT NULL,
created_at timestamptz NOT NULL DEFAULT now()
);
CREATE INDEX orders_details_gin ON orders USING gin (details);
-- Find orders that contain a given product
SELECT id, customer
FROM orders
WHERE details @> '{"items": [{"sku": "COFFEE-01"}]}';
Rich data types. Arrays, ranges, UUIDs, network addresses, geometric types, enums and custom composite types.
Extensions. PostgreSQL can be extended without forking it. Popular extensions:
- PostGIS for geographic data and spatial queries.
- pgvector for storing embeddings and running vector similarity search (used in AI and RAG applications).
- TimescaleDB for time-series data.
- pg_stat_statements for finding slow queries.
CREATE EXTENSION IF NOT EXISTS pg_stat_statements;
SELECT query, calls, round(mean_exec_time::numeric, 2) AS avg_ms
FROM pg_stat_statements
ORDER BY total_exec_time DESC
LIMIT 10;
Concurrency. PostgreSQL uses MVCC (multi-version concurrency control): readers do not block writers and writers do not block readers. Each transaction sees a consistent snapshot of the data.
Full-text search. Built-in tsvector and tsquery types with ranking and language-aware stemming, often good enough to avoid a separate search engine.
Replication and high availability. Streaming replication for read replicas and failover, and logical replication for copying selected tables between servers or versions.
Getting started in two minutes
The quickest way to try PostgreSQL locally is Docker:
docker run --name pg -e POSTGRES_PASSWORD=secret -p 5432:5432 -d postgres:latest
docker exec -it pg psql -U postgres
Inside psql:
CREATE DATABASE shop;
\c shop
CREATE TABLE products (id serial PRIMARY KEY, name text NOT NULL, price numeric(10,2) NOT NULL);
INSERT INTO products (name, price) VALUES ('Turkish coffee', 90.00), ('Simit', 25.00);
SELECT * FROM products WHERE price < 50;
From .NET, the standard driver is Npgsql, and Entity Framework Core works with the Npgsql.EntityFrameworkCore.PostgreSQL provider:
builder.Services.AddDbContext<ShopDb>(options =>
options.UseNpgsql(builder.Configuration.GetConnectionString("Shop")));
When PostgreSQL is a good choice
- General-purpose web and mobile backends.
- Applications that need both relational data and flexible JSON fields.
- Geospatial applications (with PostGIS).
- AI features that need vector search next to business data (with pgvector).
- Teams that want to avoid vendor lock-in and license costs.
When to consider something else
- Embedded or on-device storage: SQLite is simpler.
- Very heavy analytical queries over billions of rows: a column store such as ClickHouse or a data warehouse may be faster.
- Existing Microsoft-centric stacks with heavy use of SQL Server features (SSIS, SSRS, T-SQL procedures) may not gain enough to justify a migration.
- Massive horizontal write scaling across many nodes: plain PostgreSQL scales up well, but scaling writes out needs extensions or distributed variants (for example Citus).
FAQ
Is PostgreSQL free for commercial use? Yes. The license explicitly allows commercial use without fees.
Do I have to open-source my application if I use PostgreSQL? No. The license has no copyleft requirement.
Is there a paid version with more features? Not from the PostgreSQL project. Companies sell hosting, support and their own extensions, but the database itself is complete and free.
Is PostgreSQL the same as Postgres? Yes. “Postgres” is the common short name; the official name is PostgreSQL.
How long is each version supported? Five years from its first release.
