Foreign key relationships
pg_relationshipsMap PostgreSQL foreign key relationships: see which tables reference which columns, including ON DELETE/ON UPDATE actions, with optional table or schema filters and Mermaid ER diagram output.
Instructions
Show the foreign key graph: which table references which, through which columns, with ON DELETE / ON UPDATE actions.
table limits it to the relationships that touch one table (both directions);
schema to those that touch a schema; with neither it covers every user schema.
format="mermaid" returns a Mermaid erDiagram (entities with their key columns and
the relationships) that can be pasted into documentation or a Markdown viewer.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "pg_relationships"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| table | No | ||
| format | No | json | |
| schema | No | ||
| connection | No |