pg-checkup
Workspace
HomeReports
GitHub
Run on GitHub
Learn
OverviewQuickstartChecks referenceTables that only growConnectingRun it on your machineMigration checksTools that helpSecurity & privacyUse with AI agentsMCP serverFAQ
Help
File a ticketRequest a featurePricing
PrivacyTerms
Docs/Migration checks
Sign inNew checkupC

Migration checks

Compare a database before and after a move or a schema change. Runs locally. Uploads nothing.

1. Schema, grants and settings

npx pg-checkup baseline -h OLD_HOST -U checkup_reader -d app -o before.json
npx pg-checkup verify before.json -h NEW_HOST -U checkup_reader -d app

Differences come in three groups: Needs fixing, Check these, Expected.

It compares extensions, schemas, tables, columns, indexes, constraints, RLS, policies, functions, triggers, views, types, sequences, roles, grants and key settings. It does not compare rows.

Function and view bodies are saved as hashes. Defaults can contain literal values, so keep baseline files private. Sequence values need SELECT on the sequences.

2. Query timing

Run on each side during normal traffic, after the cache is warm:

npx pg-checkup observe -h OLD_HOST -U checkup_reader -d app --seconds 300 --representative -o before-window.json
npx pg-checkup observe -h NEW_HOST -U checkup_reader -d app --seconds 300 --representative -o after-window.json
npx pg-checkup compare before-window.json after-window.json

Needs PostgreSQL 14+ and pg_stat_statements. It measures the change during each window. It does not create traffic.

The result says "inconclusive" when windows are short, traffic differs, or statistics were reset. A slower query after a move is not proof the move caused it.

Exit codes: 0 done, 1 regressions, 2 error, 3 login refused, 4 inconclusive.

Not covered

Only PostgreSQL objects are compared. Test auth, file storage, functions, secrets and connection pooling separately.

PreviousRun it on your machineNextTools that help