How to Understand the Postgres Open Source License in PostgreSQL

Galaxy Glossary

What does the PostgreSQL open source license allow and require?

The PostgreSQL open source license is a permissive MIT-style license that lets you freely use, modify, and distribute PostgreSQL with minimal obligations.

Sign up for the latest in SQL knowledge from the Galaxy Team!
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.

Description

What is the PostgreSQL open source license?

The PostgreSQL License is a permissive open source license similar to the MIT or BSD licenses. It grants full rights to use, copy, modify, and distribute PostgreSQL in any form, including commercial products, with only minimal attribution requirements.

Is PostgreSQL free for commercial use?

Yes. The license allows commercial usage without royalties or copyleft. You can embed PostgreSQL in SaaS platforms, on-prem products, or mobile apps without releasing your own source code.

Do I need to publish my source code?

No. The license imposes no copyleft. You only need to retain the PostgreSQL copyright notice and a disclaimer of warranty in your product documentation or about page.

How do I reference the license in my application?

Add the license text (COPYRIGHT and DISCLAIMER sections) to your NOTICE or LICENSE file. Include a brief attribution such as “PostgreSQL® is licensed under the PostgreSQL License.” in your docs or UI.

How can I view the license from the database?

While SQL has no built-in SHOW LICENSE, you can query the PostgreSQL version string, which references the license indirectly.

SELECT version();

The result includes “PostgreSQL” and version details; consult the official site for the exact license text.

Can I modify and redistribute PostgreSQL binaries?

Yes. You may fork PostgreSQL, apply patches, compile binaries, and redistribute them. You must keep the original copyright notice and disclaimer intact.

What obligations do I have when shipping PostgreSQL?

Only two: retain the copyright notice and the liability disclaimer. No patent clauses or contributor license agreements are required.

Common mistakes with the PostgreSQL license

Ignoring attribution requirements

Some teams strip the copyright notice when redistributing PostgreSQL binaries. This violates the license. Always include the NOTICE file.

Assuming copyleft applies

Others fear they must open-source proprietary code linked to PostgreSQL. The license is permissive; no such obligation exists.

Best practices for compliance

Store the full license text in your repository, container images, and installation packages. Automate license scanning in CI to confirm the notice remains present after builds.

How to check your PostgreSQL version and build options

SELECT string_agg(name || '=' || setting, E'\n') AS build_info
FROM pg_settings
WHERE name IN ('server_version', 'server_version_num', 'integer_datetimes');

Knowing the version helps locate the matching license text on the PostgreSQL website for auditing.

Why How to Understand the Postgres Open Source License in PostgreSQL is important

How to Understand the Postgres Open Source License in PostgreSQL Example Usage


-- Check PostgreSQL version to verify license source
SELECT version();

How to Understand the Postgres Open Source License in PostgreSQL Syntax


There is no SQL syntax for the license itself. To inspect version information related to licensing, you can run:

-- Get PostgreSQL server version
SELECT version();

-- Show key build settings
SELECT name, setting
FROM pg_settings
WHERE name LIKE 'server_version%';

Common Mistakes

Frequently Asked Questions (FAQs)

Is PostgreSQL really free for enterprise products?

Yes, you can embed PostgreSQL in commercial or proprietary software without paying fees or releasing your own source code. Just keep the copyright notice.

Does the license include a patent grant?

No explicit patent clause exists. However, the PostgreSQL Global Development Group has never enforced patents against users. Most companies treat it as safe for production.

Can I rename PostgreSQL in my fork?

You may fork and rename but cannot use the registered trademark “PostgreSQL” in a way that implies official endorsement. Follow the trademark policy.

Want to learn about other SQL terms?

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo
Welcome to the Galaxy, Guardian!
Oops! Something went wrong while submitting the form.