List constraints
list_constraintsList constraints on a PostgreSQL table: primary/foreign keys, unique, check, and exclusion constraints, with names, types, and SQL. Use fresh=true to bypass cache after schema changes.
Instructions
List a table's constraints — primary/foreign keys, unique, check, exclusion. Set fresh=true to bypass the cache and re-read live (e.g. after a schema change). Returns a list of objects with name, type, and definition (the constraint SQL).
Example: list_constraints(schema='public', table='orders')
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fresh | No | ||
| table | Yes | ||
| schema | Yes | ||
| database | No | Optional: target a configured secondary (read-only) database by name; omit for the primary. Call list_databases to see the configured ids. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |