supabase/postgres(新しいタブで開きます)
主要言語: Nix
Unmodified Postgres with some useful extensions
- star 数
- 1,800
- watcher 数
- 41
- fork 数
- 272
- issue 数
- 96
- 最終更新
- 2026/10/30
主要言語: Nix
Unmodified Postgres with some useful extensions
This guide covers getting up and running with Supabase Postgres. After reading this guide, you will understand:
Supabase Postgres is a batteries-included PostgreSQL distribution that provides unmodified PostgreSQL with a curated set of the most useful extensions pre-installed. Think of it as PostgreSQL with superpowers - you get the reliability and power of standard PostgreSQL, plus immediate access to extensions for tasks like:
The goal is simple: make it fast and easy to get started with a production-ready PostgreSQL setup without having to hunt down, compile, and configure dozens of extensions yourself.
Supabase Postgres follows these core principles:
Here's a comprehensive overview of the project's directory structure:
| File/Directory | Purpose |
|---|---|
| nix/ | Core build system directory containing all Nix expressions for building PostgreSQL and extensions |
| nix/postgresql/ | PostgreSQL version configurations, patches, and base package definitions |
| nix/ext/ | Individual extension package definitions and build configurations |
| nix/ext/wrappers/ | Wrapper scripts and utilities for extensions |
| nix/ext/tests/ | Extension-specific integration test suites implemented using nixos-test |
| nix/overlays/ | Nix overlays for customizing and overriding package definitions |
| nix/tools/ | Build tools, utilities, and helper scripts |
| nix/docker/ | Docker image build definitions using Nix |
| nix/tests/ | postgres specific test suites for validating builds, including pg_regress tests |
| nix/tests/smoke/ | Quick smoke tests for basic functionality |
| nix/tests/migrations/ | Migration and upgrade test scenarios |
| nix/tests/expected/ | Expected pg_regress test outputs for validation |
| nix/tests/sql/ | SQL test scripts that are run in pg_regress tests |
| nix/docs/ | Build system documentation |
| ansible/ | Infrastructure as Code for server configuration and deployment of production hosted AWS AMI image |
| ansible/playbook.yml | Main Ansible playbook for PostgreSQL/PostgREST/pgbouncer/Auth server setup |
| ansible/tasks/ | Modular Ansible tasks for specific configuration steps |
| ansible/files/ | Static files, scripts, and templates used by Ansible |
| ansible/postgres_release.yml | Packaged Postgres release version per major (Docker/AMI tags) |
| ansible/vars.yml | AMI version tracking, legacy package version tracking |
| migrations/ | Database migration management and upgrade tools |
| migrations/db/ | Database schema migrations |
| migrations/db/migrations/ | Individual migration files |
| migrations/db/init-scripts/ | Database initialization scripts |
| migrations/tests/ | Migration testing infrastructure |
| migrations/tests/database/ | Database-specific migration tests |
| migrations/tests/storage/ | Storage-related migration tests |
| migrations/tests/extensions/ | Extension migration tests |
| Dockerfile-15 | Docker image definition for PostgreSQL 15 |
| Dockerfile-17 | Docker image definition for PostgreSQL 17 |
| tests/ | Integration and system tests |
| testinfra/ | Infrastructure tests using pytest framework |
| tests/ | General integration test suites |
| docs/ | Additional documentation, images, and resources |
| packer/ | Packer templates and AWS EBS surrogate scripts for AMI creation |
| packer/{amd64,arm64}.vars.pkr.hcl | Architecture-specific Packer variables (e.g. instance type) |
| http/ | HTTP-related configurations and files |
| rfcs/ | Request for Comments - design documents and proposals |
| db/ | Database-related utilities and configurations |
| .github/ | GitHub-specific configurations (Actions, templates, etc.) |
| Root Config Files | |
| .gitignore | Git ignore patterns |
| .envrc.recommended | Recommended environment variables for development |
| CONTRIBUTING.md | Contribution guidelines |
| README.md | Main project documentation |
Extensions are the superpower of PostgreSQL. They add functionality without modifying the core database. Supabase Postgres includes dozens of pre-built extensions covering:
The project supports multiple PostgreSQL versions simultaneously:
Each version has its own set of compatible extensions defined in the Nix build system.
The project uses Nix as its build system, which provides:
To skip hours of building and download packages instead, start using the Supabase Postgres Nix binary cache: nix/docs/binary-cache.md.
To build PostgreSQL with extensions locally:
# Build PostgreSQL 15 with extensions nix build .#psql_15/bin # Build PostgreSQL 17 nix build .#psql_17/bin # Build a specific extension nix build .#psql_17/exts/pg_graphql
# Run all tests nix flake check -L # Run specific test suite (for macos apple silicon for example) nix build .#checks.aarch64-darwin.psql_17 -L
# Build Docker image for PostgreSQL 15 docker build -f Dockerfile-15 -t supabase-postgres:15 . # Build Docker image for PostgreSQL 17 docker build -f Dockerfile-17 -t supabase-postgres:17 .
Now that you understand the basics of Supabase Postgres:
This is the same PostgreSQL build that powers Supabase, battle-tested in production by over one million projects.
Extension versions are pinned per PostgreSQL major version in
nix/ext/versions.json.
This is only available for our AWS EC2
| Goodie | Version | Description |
|---|---|---|
| PgBouncer | 1.25.1 | Set up Connection Pooling. |
| PostgREST | v14.18 | Instantly transform your database into an RESTful API. |
| WAL-G | v2.0.1, v3.0.9 | Tool for physical database backup and recovery. |
See the documentation index for installation instructions.
The PostgreSQL License. We realize that licensing is tricky since we are bundling all the various plugins. If we have infringed on any license, let us know and we will make the necessary changes (or remove that extension from this repo).
We are building the features of Firebase using enterprise-grade, open source products. We support existing communities wherever possible, and if the products don’t exist we build them and open source them ourselves.