How to Comply With the Snowflake Open Source License in PostgreSQL

Galaxy Glossary

How do I use the Snowflake open source license in PostgreSQL?

The Snowflake open-source license (Apache 2.0) defines how you may use, modify, and redistribute Snowflake-released code inside PostgreSQL projects.

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

Table of Contents

What does the Snowflake open source license allow?

The license is Apache 2.0, letting you use Snowflake-authored libraries in proprietary or open projects, provided you keep the copyright header and NOTICE file intact.

When must I reference the license in SQL?

Any time you copy Snowflake-released SQL, functions, or sample data into your own repository you must retain the full license text or a compliant header at the top of each file.

How do I add a license header to PostgreSQL scripts?

Place the header in a block comment before any SQL statements so editors and CI tools can detect it automatically.

Step-by-step syntax

Copy the template below, replace placeholders, and commit the file.

/*
Snowflake Open Source License Header
Copyright (c) <YEAR> <YOUR COMPANY>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0
*/

How can I verify compliance automatically?

Use a pre-commit hook or CI step that scans *.sql for the words “Apache License, Version 2.0”. Fail the build if any file is missing the header.

Example: licensed query in an ecommerce database

/*
Snowflake Open Source License Header — 2024 DataNova Inc.
Licensed under the Apache License, Version 2.0
*/

SELECT c.id,
c.name,
o.order_date,
o.total_amount
FROM Customers AS c
JOIN Orders AS o ON o.customer_id = c.id
WHERE o.order_date >= CURRENT_DATE - INTERVAL '30 days';

Best practices for teams

Keep a central LICENSE file, add a NOTICE file listing third-party dependencies, and educate reviewers to reject pull requests that strip headers.

Common mistakes and fixes

Omitting the full header. Always paste the entire block comment, not a shortened version.

Altering license terms. Never delete clauses—add your own text below the original if needed.

Key takeaways

Retain headers, automate checks, and you can safely blend Snowflake code with PostgreSQL workloads.

Why How to Comply With the Snowflake Open Source License in PostgreSQL is important

How to Comply With the Snowflake Open Source License in PostgreSQL Example Usage


/*
Snowflake Open Source License Header — 2024 DataNova Inc.
Licensed under the Apache License, Version 2.0
*/

-- Top 5 customers by spend last month
SELECT c.name,
       SUM(o.total_amount) AS total_spend
FROM   Customers c
JOIN   Orders    o ON o.customer_id = c.id
WHERE  o.order_date >= date_trunc('month', CURRENT_DATE) - INTERVAL '1 month'
GROUP  BY c.name
ORDER  BY total_spend DESC
LIMIT  5;

How to Comply With the Snowflake Open Source License in PostgreSQL Syntax


/*
Snowflake Open Source License Header
Copyright (c) <YEAR> <ORGANIZATION>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    https://www.apache.org/licenses/LICENSE-2.0
*/

-- Example query on ecommerce tables
SELECT c.id,
       c.name,
       o.order_date,
       o.total_amount,
       p.name  AS product_name,
       p.price AS unit_price
FROM   Customers  AS c
JOIN   Orders     AS o ON o.customer_id = c.id
JOIN   OrderItems AS oi ON oi.order_id  = o.id
JOIN   Products   AS p  ON p.id         = oi.product_id
WHERE  o.order_date >= CURRENT_DATE - INTERVAL '30 days';

Common Mistakes

Frequently Asked Questions (FAQs)

Is the Snowflake open source license copyleft?

No. Apache 2.0 is permissive, so you can combine the code with proprietary projects if you keep the notice intact.

Do I need to open-source my own SQL when I use Snowflake samples?

No. The license does not require you to publish your modifications, only to retain the license notice.

Where should the NOTICE file live?

Place NOTICE at the repository root so build scripts and auditors can discover it easily.

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.