DBLab vs pg-schema-diff
plan an online change, then run it on a clone
pg-schema-diff by Stripe diffs a target schema against PostgreSQL and plans online DDL with hazards. DBLab runs the plan on a full-size clone and measures its locks.
What DBLab adds to pg-schema-diff
Each point pairs what our documentation says with what the pg-schema-diff documentation says. Follow the links and check.
Runs the migration on full-size data
DBLabDB Migration Checker applies pending migrations to a full-size clone in CI and collects statistics from the run. docs
Measures the locks a migration holds
DBLabThe checker fails a migration that holds a dangerous lock longer than a limit, 10 seconds by default. docs
Run it again from the same state
DBLabOn a clone, reset returns the data to the snapshot, so a migration can be run again. docs
Short answer
pg-schema-diff is an open-source Go library and CLI from Stripe. You describe the schema you want in plain DDL; it diffs it against a database and generates a plan that uses online operations such as concurrent index builds and NOT VALID constraints, with hazards for anything risky. It validates the plan on a temporary database that has the same schema but no data. DBLab does not plan or deploy changes; it gives you a full-size clone. Together: generate the plan with pg-schema-diff and apply it to a DBLab clone to see its duration and locks on real data before production.
What pg-schema-diff does that DBLab does not
- Declarative: you keep the target schema as DDL files, and pg-schema-diff works out the statements to get there. DBLab does not write or order migrations.
- Plans use online operations: concurrent index builds, new indexes built before old ones are dropped, CHECK and foreign key constraints added NOT VALID then validated, NOT NULL via a check constraint.
- Each plan statement carries its own statement_timeout and lock_timeout, and risky statements carry hazards such as ACQUIRES_ACCESS_EXCLUSIVE_LOCK, INDEX_BUILD or DELETES_DATA.
- apply refuses a plan whose hazards are not listed in --allow-hazards, and asks for confirmation before it runs.
- It is a Go library as well as a CLI, so it can be built into your own deploy tooling.

What you get
A clone in the DBLab UI, ready for connections 1.67 seconds after it was requested (a 2.7 GiB demo database). How it works
DBLab and pg-schema-diff, side by side
| Question | DBLab | pg-schema-diff |
|---|---|---|
| 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. docsdocs 2 | A Go library and CLI that computes the differences between Postgres schemas and generates the SQL to migrate from one to the other with minimal downtime and locks. The desired schema is defined in plain DDL. The README says the project is in its early stages. 1 |
| Runs the change on full-size data | YesDB Migration Checker applies pending migrations to a full-size clone in CI and collects statistics from the run. docs | PartlyPlan validation runs the migration against a temporary database with the same schema as the original and checks that it reaches the target schema. The code creates that schema in an empty database and runs the plan with timeouts ignored, so validation does not test against your data. 134 |
| Lock and downtime risk | YesMeasured on the clone: the checker fails a migration that holds a dangerous lock longer than a limit, 10 seconds by default. docs | PartlyPredicted at plan time, not measured. Statements carry hazards such as ACQUIRES_ACCESS_EXCLUSIVE_LOCK, ACQUIRES_SHARE_LOCK, INDEX_BUILD and DELETES_DATA, and the plan sets lock_timeout and statement_timeout for each statement. The README says not all migrations are lock-free and some may need downtime. 12 |
| Static review and lint rules | NoNone. DBLab runs the change; it does not lint SQL. docs | PartlyThe sources we reviewed do not describe lint rules for SQL you write; pg-schema-diff writes the SQL itself. Its review step is the hazard list attached to each generated statement, which apply checks against the hazards you allow. 125 |
| Writing, versioning and deploying migrations | NoNot provided. Keep your migration tool; a clone is an ordinary PostgreSQL server that any tool can connect to. docs | YesDeclarative: dump an existing schema, edit the DDL files, then plan and apply against a database by connection string. Library users apply the plan themselves; the README leaves plan application up to the user. Renames are treated as a drop and an add, and of custom types only enums are supported. 14 |
| Approvals and audit trail | NoNot a change-approval system. DBLab EE adds SSO, user management and audit for access to clones. docs | Partlyapply fails if the plan contains hazards not listed in --allow-hazards, and prompts for confirmation unless --skip-confirm-prompt is set. The README suggests a second user may approve a plan before it is applied. An audit trail is not documented in the sources we reviewed. 15 |
| Rollback | Not provided for production. On a clone, reset returns the data to the snapshot, so a migration can be run again. docs | Not documented in the sources we reviewed. Statements marked DELETES_DATA warn that a change removes data. 12 |
| CI integration | The checker runs in CI; the documented example uses GitHub Actions. Any pipeline can also create clones through the API or CLI. docsdocs 2 | Not documented in the sources we reviewed. pg-schema-diff is a CLI and a Go library that connect to Postgres by connection string. 14 |
| Open source and hosting | YesOpen source under Apache 2.0, self-hosted in any cloud or on-premises. docs | YesOpen source under the MIT license, from Stripe. Install the CLI with Homebrew or go install, or use it as a Go library. Version 1.0.9 was released on August 6, 2026. 126 |
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 |
| pg-schema-diff | Open source | Free | MIT license 1 |
List prices on 18 Nov 2026. The billing units differ, so this is not a total-cost comparison. DBLab pricing
Using DBLab with pg-schema-diff
pg-schema-diff produces the statements; DBLab shows what they do on real data. Point pg-schema-diff plan or apply at a DBLab clone with --from-dsn: the plan is generated against the clone's schema and applied with its own lock and statement timeouts to a full-size copy of the data. You see how long the concurrent index builds and constraint validations take and whether any statement hits a timeout. Reset the clone and try again. Then run apply against production, which plans again from the production schema. pg-schema-diff lists PostgreSQL 14 to 17 as supported, so the clone should run one of those versions.
Questions
- Is pg-schema-diff open source?
- Yes. Stripe publishes it on GitHub under the MIT license, as a CLI and a Go library. The README says the project is in its early stages and the maintainers have limited time to review direct code contributions. 1
- Does pg-schema-diff test a migration on real data?
- Not by itself. Plan validation runs the plan on a temporary database with an identical schema and no data, and checks that the result matches the target schema. To see duration and locks on real data, apply the plan to a full-size copy such as a DBLab clone. 34
- Which PostgreSQL versions does pg-schema-diff support?
- 14, 15, 16 and 17. The README says 13 and older are not supported. 1
- Can I use DBLab and pg-schema-diff together?
- Yes. A DBLab clone is an ordinary PostgreSQL server, so pg-schema-diff can plan and apply against it by connection string. Run the plan on the clone to measure it, reset the clone, then run apply against production. 1
Try a clone before you install anything
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.
Sources
- pg-schema-diff repository and README
- pg-schema-diff Go package docs: diff
- pg-schema-diff source: plan generator and validation
- pg-schema-diff source: plan command
- pg-schema-diff source: apply command
- pg-schema-diff releases
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. Found a mistake? Tell us and we will correct the page.
More comparisons
- Atlasrun a change on real data vs plan and lint it
- Bytebasetest a change on real data, then deploy it
- Flywaytest on a full-size clone, deploy with migrations
- Liquibaserun a change on a clone, ship it with changelogs
- pgrolltest a change on a clone, then roll it out
- Sqitchdeploy and revert scripts, tested on a clone
- Squawklint migration SQL, then run it on a clone
- All comparisons