BaseDiff analyzes two PostgreSQL databases, detects structural differences and generates ready-to-use migration scripts automatically.
BaseDiff fully respects the unique architecture of PostgreSQL — from trigger-function model to extension filtering.
Tracks data types including character varying(50),
decimal(18,2). Detects nullable, default values,
collation and column order. Supports both legacy
nextval sequences and modern
GENERATED ALWAYS AS IDENTITY (PostgreSQL 10+).
Analyzes both the trigger definition and the associated trigger
function (pg_get_functiondef). Detects timing
(BEFORE / AFTER), event scope
(INSERT, UPDATE, DELETE,
TRUNCATE) and enabled/disabled state.
Distinguishes all PostgreSQL function types via prokind:
standard functions (f), procedures (p),
aggregate functions (a) and window functions
(w). Compares full definitions and parameter signatures.
Full support for PRIMARY KEY, FOREIGN KEY (including schema, table
and column references), UNIQUE, CHECK (pg_get_expr)
and EXCLUSION constraints.
Intelligently filters objects from extensions such as PostGIS,
Unaccent and TimescaleDB. Automatically ignores system schemas
(pg_catalog, pg_toast,
information_schema) for a clean comparison.
Detects unique and composite indexes using indisunique
and indisprimary. Supports multi-column indexes with
correct column order.
Compares complete view definitions via pg_get_viewdef.
Filters materialized views and views from extensions for
a clean result.
Export to a single file or separate files for CREATE, ALTER, DROP and data migration scripts. Copy to clipboard or save to disk.
Configure source and target PostgreSQL connections. Enter host, port, database name and credentials. Swap source and target with one click.
BaseDiff analyzes both PostgreSQL schemas and displays all differences in a clear tree structure. Review each object and its SQL definition.
Review generated migration scripts, edit if needed and export to files. Apply scripts to synchronize your target PostgreSQL database.
Download BaseDiff for free and generate your first migration script in minutes.