find_dependents
Identify all database objects that depend on a given object before dropping it. Recursively walks pg_depend, classifying dependents (views, foreign keys, functions, etc.) and reporting depth to show the blast radius of DROP CASCADE.
Instructions
Find what depends on a database object before dropping it. Recursively walks pg_depend, classifies dependents (views, foreign keys, functions, materialized views, indexes, rules) and reports each with its depth from the target. Use this BEFORE running DROP CASCADE to understand the blast radius. Returns the dependent objects flattened with depth (1 = directly depends, 2 = depends on a depth-1 dependent, etc).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Object name. | |
| kind | No | table | |
| schema | No | public | |
| max_depth | No | Recursion limit (1-10). | |
| server | No | ||
| database | No | ||
| override_schema | No |