Compare two schemas or environments
pg_compare_schemasCompare a PostgreSQL schema across two read-only connections to identify objects only in the source or target and differing definitions, including tables, columns, indexes, views, and functions.
Instructions
Compare one schema on two connections (for example development and production, or before and after a migration): what exists only in the source, only in the target, and what differs.
Compared: tables, columns (type, nullability, default, identity), indexes, constraints, views (definition), functions (signature, language, volatility and a hash of the body), sequences and types.
schema is the schema on the source; target_schema the schema on the target when it
has another name. include limits the comparison to some of the kinds. Both
connections are read only, and both follow their approval rules. Nothing is changed.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"source_connection": "<source_connection>",
"target_connection": "<target_connection>",
"schema": "<schema>"
},
"name": "pg_compare_schemas"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schema | Yes | ||
| include | No | ||
| target_schema | No | ||
| source_connection | Yes | ||
| target_connection | Yes |