# DBLab vs pgroll: test a change on a clone, then roll it out

> pgroll applies reversible PostgreSQL schema changes with expand/contract. DBLab measures a migration's locks on a full-size clone and can reset it for a rerun.

Checked on 2026-11-18. Page: https://postgres.ai/compare/dblab-vs-pgroll. All comparisons: https://postgres.ai/compare.

## Short answer

pgroll is an open-source CLI that applies PostgreSQL schema changes without breaking running clients: it expands the schema, backfills new columns, serves old and new versions through views, and contracts once old clients are gone. An active migration can be rolled back instantly. DBLab does not deploy changes. It gives you a full-size thin clone of a PostgreSQL database where a migration can be run to see how long it takes and which locks it holds. The two fit together: run pgroll start on a clone, then on production.

## What DBLab adds to pgroll

1. **Measures the locks a migration holds.**
   - DBLab: The checker fails a migration that holds a dangerous lock longer than a limit, 10 seconds by default. ([DB Migration Checker](https://postgres.ai/docs/database-lab/db-migration-checker))
   - pgroll: pgroll keeps locks short by design: declarative operations, lock_timeout of 500 ms on its DDL, batched backfills. For raw SQL operations its docs warn that it cannot ensure the change is safe and will not cause application downtime. [5][6][7][10]
2. **Run it again from the same state.**
   - DBLab: On a clone, reset returns the data to the snapshot, so a migration can be run again. ([How to reset a DBLab clone](https://postgres.ai/docs/dblab-howtos/cloning/reset-clone))
   - pgroll: pgroll rollback removes the new schema version of an active migration and leaves the old one unchanged. Its docs state that migrations cannot be rolled back once completed. [8]
3. **Runs the migration on full-size data.**
   - DBLab: DB Migration Checker applies pending migrations to a full-size clone in CI and collects statistics from the run. ([DB Migration Checker](https://postgres.ai/docs/database-lab/db-migration-checker))
   - pgroll: pgroll runs migrations against the instance given by --postgres-url, and pgroll validate checks a file for syntax errors, invalid options and unknown database objects. The sources we reviewed do not describe running a migration on a copy first. [6][9]

## Try a clone before you install anything

```
dblab clone create --username dev --password "$PASSWORD" --id test
```

The public demo runs DBLab Engine: open it with the token demo-token, create a clone and connect to it. DBLab Engine is open source, so the next step is a machine of your own.

- [Open the DBLab demo](https://demo.dblab.dev)
- [Install DBLab Engine](https://postgres.ai/docs/dblab-howtos/administration/install-dle-manually)

## Side by side

| | DBLab | pgroll |
|---|---|---|
| What it is | Thin clones of a full-size PostgreSQL database, used to run a schema change on real data before it ships. DBLab does not write, order or deploy migrations. | An open-source command-line tool for safe, reversible, zero-downtime schema migrations on PostgreSQL. It creates virtual schemas of views on top of the physical tables, so old and new schema versions are available at the same time during a migration. [1][2] |
| Runs the change on full-size data | Runs on full-size data: yes. DB Migration Checker applies pending migrations to a full-size clone in CI and collects statistics from the run. | Not documented in the sources we reviewed. pgroll runs migrations on the database given by --postgres-url. pgroll validate checks a migration file for syntax errors, invalid options and references to unknown database objects. [6][9] |
| Lock and downtime risk | Measures locks: yes. Measured on the clone: the checker fails a migration that holds a dangerous lock longer than a limit, 10 seconds by default. | Measures locks: partly. Reduced by design: migrations are declarative so pgroll can hold required locks for the shortest possible time, all pgroll DDL uses lock_timeout (500 ms by default), and backfills run in batches with an optional delay. The sources we reviewed do not describe measuring lock time. For raw SQL operations, the docs warn that pgroll cannot ensure the change is safe and will not cause downtime. [5][6][7][10] |
| Static review and lint rules | Lint rules: no. None. DBLab runs the change; it does not lint SQL. | Lint rules: partly. pgroll validate checks a migration for syntax errors in the pgroll format, unknown or invalid options and unknown database objects. The sources we reviewed do not describe lint rules for SQL. [9] |
| Writing, versioning and deploying migrations | Deploys migrations: no. Not provided. Keep your migration tool; a clone is an ordinary PostgreSQL server that any tool can connect to. | Deploys migrations: yes. Migrations are YAML or JSON files listing operations, such as create_table, or raw SQL. pgroll start applies additive changes and creates a new version schema; pgroll complete drops the old version once no client uses it. pgroll baseline captures an existing schema first. [12][10][4][7] |
| Approvals and audit trail | Approval workflow: no. Not a change-approval system. DBLab EE adds SSO, user management and audit for access to clones. | Not documented in the sources we reviewed. pgroll keeps its migration state in a pgroll schema in the database. [6] |
| Rollback | Not provided for production. On a clone, reset returns the data to the snapshot, so a migration can be run again. | pgroll rollback removes the new schema version of an active migration, leaving the old one unchanged. Migrations cannot be rolled back once completed. [8][2] |
| CI integration | The checker runs in CI; the documented example uses GitHub Actions. Any pipeline can also create clones through the API or CLI. | In CI/CD, pgroll latest schema returns the newest version schema name, which can be passed to the application so tests run against the latest changes. Clients choose a version by setting search_path. [11] |
| Open source and hosting | Open source: yes. Open source under Apache 2.0, self-hosted in any cloud or on-premises. | Open source: yes. Apache 2.0 license; a single Go binary with no external dependencies that you run yourself against your own database. Made by Xata. [1][2] |

## What pgroll does that DBLab does not

- pgroll deploys the change itself: old and new schema versions work at the same time through views, so applications can be rolled out side by side. DBLab does not deploy anything.
- An active migration rolls back instantly: the new schema version is removed and the old one was never changed.
- Breaking column changes are handled by adding a new column, backfilling it in batches (1,000 rows by default) and keeping both in sync with triggers.
- Every DDL operation runs with a lock_timeout, 500 ms by default, and migrations are declarative so pgroll can keep the locks it needs short.
- Free and open source under Apache 2.0, a single Go binary that works with any Postgres service, including RDS and Aurora.

## Pricing

| Product | Plan | List price | Notes |
|---|---|---|---|
| DBLab | DBLab Engine | Free | Open source, Apache 2.0; you run it |
| DBLab | DBLab SE | From $62/month | Billed hourly by machine size, plus your own cloud costs; 2,000 GiB limit; single user |
| DBLab | DBLab EE | Custom | Annual contract, from $0.2662 per 100 GiB per hour; unlimited database size, SSO |
| pgroll | Open source | Free | Apache 2.0; you run it [1] |

DBLab prices: https://postgres.ai/pricing.

## Using both

The two cover different steps of the same change. In CI, a job creates a DBLab clone through the API or CLI and runs pgroll start against it, so the team sees how long the backfill takes and which locks the change holds on full-size data; pgroll rollback or a clone reset clears it for the next run. Then pgroll start runs on production, new application versions move to the new version schema, and pgroll complete finishes the change. DBLab does not deploy anything.

## Questions

### Is pgroll open source?

Yes. The repository on GitHub, maintained by Xata, is under the Apache License 2.0. pgroll is a single Go binary. [1][2]

### Which PostgreSQL versions does pgroll support?

PostgreSQL 14.0 or later, on any Postgres service including RDS and Aurora. On Postgres 14, row level security policies are not respected by its versioned views. [2][3]

### Can a pgroll migration be rolled back?

Yes, while it is active. pgroll rollback removes the new schema version and leaves the old one as it was. Once pgroll complete has run, a migration cannot be rolled back. [8]

### Does pgroll test a migration on production-size data?

The sources we reviewed do not describe that. pgroll applies a migration to the database you give it, and validate checks the file. Backfill time and lock waits depend on the data, so you can run pgroll start on a DBLab clone first. [6][9]

### Can I use DBLab and pgroll together?

Yes. A DBLab clone is an ordinary PostgreSQL server, so CI can run pgroll start on a clone to see duration and locks on full-size data, then pgroll runs the same migration on production. DBLab does not deploy migrations, so it does not replace pgroll. [2][6]

## Sources for DBLab

- [DB Migration Checker](https://postgres.ai/docs/database-lab/db-migration-checker)
- [How to reset a DBLab clone](https://postgres.ai/docs/dblab-howtos/cloning/reset-clone)
- [DBLab Engine](https://postgres.ai/docs/database-lab)
- [Database migration testing](https://postgres.ai/products/database-migration-testing)

## Sources for pgroll

1. [pgroll repository on GitHub](https://github.com/xataio/pgroll)
2. [pgroll README](https://raw.githubusercontent.com/xataio/pgroll/main/README.md)
3. [pgroll docs: getting started](https://raw.githubusercontent.com/xataio/pgroll/main/docs/getting-started.md)
4. [pgroll docs: concepts](https://raw.githubusercontent.com/xataio/pgroll/main/docs/concepts.md)
5. [pgroll docs: why use pgroll](https://raw.githubusercontent.com/xataio/pgroll/main/docs/why-use-pgroll.md)
6. [pgroll docs: CLI global flags](https://raw.githubusercontent.com/xataio/pgroll/main/docs/cli/README.md)
7. [pgroll docs: start](https://raw.githubusercontent.com/xataio/pgroll/main/docs/cli/start.mdx)
8. [pgroll docs: rollback](https://raw.githubusercontent.com/xataio/pgroll/main/docs/cli/rollback.mdx)
9. [pgroll docs: validate](https://raw.githubusercontent.com/xataio/pgroll/main/docs/cli/validate.mdx)
10. [pgroll docs: raw SQL operation](https://raw.githubusercontent.com/xataio/pgroll/main/docs/operations/raw_sql.mdx)
11. [pgroll docs: integrating client applications](https://raw.githubusercontent.com/xataio/pgroll/main/docs/guides/clientapps.mdx)
12. [pgroll docs: operations](https://raw.githubusercontent.com/xataio/pgroll/main/docs/operations/README.md)

## How we compare

These pages compare what each product does for PostgreSQL; other databases and the rest of the stack are out of scope. What we say about the other product comes from its own documentation, pricing page, changelog or source repository, read on the date shown; each row cites its source. "Not documented" means we did not find it in those sources, not that the product cannot do it. Prices are list prices and the billing units differ, so they are not a total-cost comparison. Product names are trademarks of their owners.
