- Home
- Database Migration Tools
- pgroll
pgroll
What it is
pgroll is an open-source command-line tool for reversible PostgreSQL schema migrations. Its expand-and-contract workflow keeps previous and new schema versions available together while client applications move between them. The project describes migrations as zero-downtime and says changes occur without locking the database. Columns can be backfilled automatically, and an active migration can return to the prior schema. For breaking changes, pgroll creates virtual schemas over physical tables and uses triggers to pass writes between old and new columns. Applications choose a version by setting PostgreSQL's search_path when connecting. pgroll supports PostgreSQL 14 and later, including RDS and Aurora, and is available as a cross-platform binary for Linux, macOS, and Windows or for self-hosting. It can convert ORM-generated SQL, with examples for Alembic, Django, and Drizzle. Those migrations may need manual data steps and SQL consolidation. On PostgreSQL 14, versioned views do not respect row-level security policies.
For and against
For
- Keeps old and new schemas available
- Supports rollback of active migrations
- Automatic column backfills
- Works with PostgreSQL 14 and later
- Apache License 2.0
Against
- PostgreSQL 14 versioned views ignore RLS policies
- ORM migrations may need manual edits
- Command-line workflow requires database expertise
The verdict
pgroll focuses on reversible, low-interruption PostgreSQL changes with simultaneous schema versions. Check the row-level security limitation and manual ORM work before adoption.
Who it suits
It suits developers managing PostgreSQL schema changes while clients remain online. Teams using ORM-generated migrations should be prepared for manual cleanup.
Plans and prices
Open source
PostgreSQL 14+ · Linux, macOS and Windows binaries · self-managed CLI
Read 15 Oct 2026 · github.com
Open-source
PostgreSQL 14.0 or later · single cross-platform binary
Read 4 Oct 2026 · github.com
On the record
- Automatic backfills
- The tool backfills existing rows in batches when a migration requires data conversion.xata.io · read 15 Oct 2026
- Backfills
- pgroll automatically backfills columns when needed.github.com · read 4 Oct 2026
- Benchmarks
- The project runs benchmarks across PostgreSQL 14 through 18 and measures backfill, trigger write amplification and schema reads.github.com · read 15 Oct 2026
- Client configuration
- Client applications select a schema version by setting PostgreSQL's search_path when connecting.github.com · read 4 Oct 2026
- Client integration
- Applications select a schema version by setting PostgreSQL search_path when connecting.github.com · read 15 Oct 2026
- CLI installation
- Prebuilt binaries are offered for Linux, macOS and Windows, with source installation through go install.github.com · read 15 Oct 2026
- Company founded
- LinkedIn lists Xata.io as founded in 2020.linkedin.com · read 15 Oct 2026
- Company headquarters
- LinkedIn lists Xata.io headquarters in San Francisco.linkedin.com · read 15 Oct 2026
- Company ownership
- LinkedIn describes Xata.io as privately held.linkedin.com · read 15 Oct 2026
- Company size
- LinkedIn lists Xata.io as having 11–50 employees.linkedin.com · read 15 Oct 2026
- Connection-leak fix
- Release 0.16.1 fixed connection leaks in the migration backfill process.github.com · read 15 Oct 2026
- Database compatibility
- pgroll supports PostgreSQL versions 14 and later and says it works with any PostgreSQL service, including RDS and Aurora.github.com · read 4 Oct 2026
- Documentation
- Documentation includes getting started material, tutorials, guides, examples and command references.github.com · read 15 Oct 2026
- Downtime
- The project describes migrations as zero-downtime and says changes are applied without locking the database.github.com · read 4 Oct 2026
- Existing databases
- A baseline command imports the structure of an already populated database before migrations begin.github.com · read 15 Oct 2026
- Expand-contract workflow
- Migrations follow an expand-and-contract lifecycle, retaining compatibility until clients move to the new schema.xata.io · read 15 Oct 2026
- Homebrew architectures
- Homebrew bottles cover macOS Apple Silicon, macOS Intel and Linux ARM64 or x86_64.formulae.brew.sh · read 15 Oct 2026
- Homebrew package
- Homebrew provides a pgroll formula with brew install pgroll.formulae.brew.sh · read 15 Oct 2026