Object dependencies
pg_dependenciesTrace what depends on a PostgreSQL object and what it depends on to see what breaks if you drop or change it, including views, foreign keys, functions, indexes and triggers.
Instructions
Show what depends on an object and what it depends on, to answer "what breaks if I drop or change this?".
dependents are the views, materialized views, foreign keys from other tables,
functions that take the table's row type, sequences, indexes, triggers and column
defaults that use the object, followed through views of views up to max_depth.
dependencies are the tables, sequences, functions, types and extensions the object
needs. Each row says whether dropping the object needs CASCADE or removes it along with
the object. name is name or schema.name; a function needs its signature when it
has overloads.
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": {
"name": "<name>"
},
"name": "pg_dependencies"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | table | |
| name | Yes | ||
| direction | No | both | |
| max_depth | No | ||
| connection | No |