Compare schemas
compare_schemasIdentify structural differences between two PostgreSQL schemas — detect added, removed, or changed tables, columns, indexes, constraints, and foreign keys. Renames appear as paired additions and removals.
Instructions
Return the structural diff between two schemas — tables/columns/indexes/constraints/foreign-keys added, removed, or changed. Base tables only; views and custom types are not compared. Renames surface as a paired add + remove.
Example: compare_schemas(left_schema='public', right_schema='staging')
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. | |
| left_schema | Yes | ||
| right_schema | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| left_schema | Yes | ||
| right_schema | Yes | ||
| tables_added | Yes | ||
| tables_changed | Yes | ||
| tables_removed | Yes |