pgroll
pgroll.com
What it is
pgroll is an open-source command-line tool for PostgreSQL schema migrations that keeps old and new schema versions available while applications move between them. Its expand/contract workflow lets clients choose a version through PostgreSQL's search_path. The project describes migrations as zero-downtime and says it applies changes without locking the database; it can also backfill columns automatically when needed. For breaking changes, pgroll builds virtual schemas from views over physical tables and uses triggers to carry writes between old and new columns. Active migrations can be rolled back to the previous schema version. It supports PostgreSQL 14 and later, including RDS and Aurora, and is available for Linux, macOS, and Windows or self-hosting. It can convert SQL generated by ORMs, with examples for Alembic, Django, and Drizzle, though manual data migrations and SQL consolidation may be needed. On PostgreSQL 14, its versioned views do not respect row-level security policies, which can make it a poor choice for RLS users on that version. The project is licensed under Apache License 2.0.
Spec sheet
- What it does
- pgroll is a command-line tool for safe, reversible PostgreSQL schema migrations designed to avoid application downtime.Read 15 Oct 2026 · github.com
- Purpose
- pgroll is an open-source command-line tool for safe, reversible PostgreSQL schema migrations that keep multiple schema versions available simultaneously.Read 4 Oct 2026 · github.com
- Platforms
- Prebuilt binaries are available for Linux, macOS, and Windows; installation is also documented through Homebrew and from source.Read 4 Oct 2026 · github.com
- Support
- Users are directed to GitHub issues, GitHub discussions and Discord for assistance.Read 15 Oct 2026 · github.com
- License
- The repository is licensed under Apache License 2.0.Read 15 Oct 2026 · github.com
- Automatic backfills
- The tool backfills existing rows in batches when a migration requires data conversion.Read 15 Oct 2026 · xata.io
- Backfills
- pgroll automatically backfills columns when needed.Read 4 Oct 2026 · github.com
- Benchmarks
- The project runs benchmarks across PostgreSQL 14 through 18 and measures backfill, trigger write amplification and schema reads.Read 15 Oct 2026 · github.com
- CLI installation
- Prebuilt binaries are offered for Linux, macOS and Windows, with source installation through go install.Read 15 Oct 2026 · github.com
- Client configuration
- Client applications select a schema version by setting PostgreSQL's search_path when connecting.Read 4 Oct 2026 · github.com
- Client integration
- Applications select a schema version by setting PostgreSQL search_path when connecting.Read 15 Oct 2026 · github.com
- Company founded
- LinkedIn lists Xata.io as founded in 2020.Read 15 Oct 2026 · linkedin.com
- Company headquarters
- LinkedIn lists Xata.io headquarters in San Francisco.Read 15 Oct 2026 · linkedin.com
- Company ownership
- LinkedIn describes Xata.io as privately held.Read 15 Oct 2026 · linkedin.com
- Company size
- LinkedIn lists Xata.io as having 11–50 employees.Read 15 Oct 2026 · linkedin.com
- Connection-leak fix
- Release 0.16.1 fixed connection leaks in the migration backfill process.Read 15 Oct 2026 · github.com
- Database compatibility
- pgroll supports PostgreSQL versions 14 and later and says it works with any PostgreSQL service, including RDS and Aurora.Read 4 Oct 2026 · github.com
- Documentation
- Documentation includes getting started material, tutorials, guides, examples and command references.Read 15 Oct 2026 · github.com
- Downtime
- The project describes migrations as zero-downtime and says changes are applied without locking the database.Read 4 Oct 2026 · github.com
- Existing databases
- A baseline command imports the structure of an already populated database before migrations begin.Read 15 Oct 2026 · github.com
- Expand-contract workflow
- Migrations follow an expand-and-contract lifecycle, retaining compatibility until clients move to the new schema.Read 15 Oct 2026 · xata.io
- Homebrew architectures
- Homebrew bottles cover macOS Apple Silicon, macOS Intel and Linux ARM64 or x86_64.Read 15 Oct 2026 · formulae.brew.sh
- Homebrew package
- Homebrew provides a pgroll formula with brew install pgroll.Read 15 Oct 2026 · formulae.brew.sh
- Homebrew version
- The Homebrew page lists stable version 0.16.3.Read 15 Oct 2026 · formulae.brew.sh
- How it works
- It creates virtual schemas using views over physical tables and uses triggers to propagate writes between old and new columns during breaking changes.Read 4 Oct 2026 · github.com
- Instant rollback
- Rollback removes the new schema version while leaving the previous version available.Read 15 Oct 2026 · github.com
- Latest release
- Release 0.16.3 was published on September 8, 2026 and mainly updates dependencies and formatting.Read 15 Oct 2026 · github.com
- Limit: JSON workflow
- Reddit commenters criticized the JSON migration DSL for verbosity, weak comments and awkward SQL mapping.Read 15 Oct 2026 · reddit.com
- Limit: one active migration
- A user report says only one active migration is supported, which can require careful sequencing and management.Read 15 Oct 2026 · github.com
- Limit: PostgreSQL 14 RLS
- On PostgreSQL 14, row-level-security policies are not respected by pgroll versioned views, making it a poor choice for RLS users on that version.Read 15 Oct 2026 · github.com
- Maintenance status
- Xata product staff said in January 2026 that pgroll remained maintained and used in Xata, while near-term work focused on bugs and stability rather than major features.Read 15 Oct 2026 · github.com
- Managed PostgreSQL services
- The README says pgroll works with any PostgreSQL service, including Amazon RDS and Aurora.Read 15 Oct 2026 · github.com
- Migration format
- Migrations are defined in a high-level JSON format that adds backfill and transformation information to normal DDL concepts.Read 15 Oct 2026 · xata.io
- Migration workflow
- pgroll uses an expand/contract workflow, keeping old and new schema versions accessible during client application rollout.Read 4 Oct 2026 · github.com
- Multi-version schemas
- Old and new schema versions remain available simultaneously during a migration.Read 15 Oct 2026 · pgroll.com
- ORM integration
- The ORM guide documents converting generated migration SQL for tools including Alembic, Django and Drizzle.Read 15 Oct 2026 · github.com
- ORM limitation
- The ORM guide says generated migrations need manual up and down data migrations, and SQL statements may need manual consolidation into fewer pgroll operations.Read 4 Oct 2026 · github.com
- PostgreSQL 14 limitation
- On PostgreSQL 14, row-level security policies are not respected by pgroll's versioned views, so the documentation says pgroll is likely a poor choice when using RLS on that version.Read 4 Oct 2026 · github.com
- PostgreSQL compatibility
- Supported PostgreSQL versions are 14 and later.Read 15 Oct 2026 · github.com
- Praise: migration concept
- A Reddit commenter said the underlying zero-downtime migration system looked very appealing even while criticizing the JSON format.Read 15 Oct 2026 · reddit.com
- Project launch
- Xata announced the first pgroll version on October 3, 2023.Read 15 Oct 2026 · xata.io
- Rollbacks
- An active migration can be rolled back to the previous schema version.Read 4 Oct 2026 · github.com
- Triggers
- During breaking changes, triggers propagate writes between old and replacement columns.Read 15 Oct 2026 · github.com
- Virtual schemas
- pgroll builds virtual schemas with views over physical tables to expose different schema versions.Read 15 Oct 2026 · github.com
- Zero-downtime migrations
- The project applies migration operations without locking data access to the table.Read 15 Oct 2026 · xata.io
Plans and prices
Strong points and limits
Strong points
- Supports rollback to the previous schema version
- Automatically backfills columns when needed
- Works with PostgreSQL 14 and later
- Available for self-hosting and multiple platforms
Limits
- PostgreSQL 14 versioned views do not respect RLS
- ORM-generated migrations may need manual data migrations
- ORM SQL may need manual consolidation
Who it suits
pgroll suits teams changing PostgreSQL schemas that need old and new versions available during application rollouts. PostgreSQL 14 users relying on row-level security should note the versioned-view limitation.
Verdict
pgroll provides a versioned expand/contract migration workflow with backfills and rollback support. Check the PostgreSQL 14 RLS limitation and the extra work its ORM guide describes before adopting it.
Where Specifiction places it
- Database Testing Tools#6 of 288.5
- Database Migration Tools#7 of 328.5