describe_table
Fetch full table schema details by name, listing columns, types, primary key, and foreign keys to discover related tables in PostgreSQL.
Instructions
Return full detail for one table by name.
Use this when you already know the table name: either search_schema returned it and you need the complete column list, or search_schema did not return it and you believe it exists anyway. This does not use the ranking, so it is the reliable way to reach a table that retrieval scored poorly.
Accepts either a qualified name ("sales.salesorderheader") or a bare one ("salesorderheader"). Returns columns with types and comments, the primary key, foreign keys out, and the foreign keys pointing in, which is how you find the tables that join to this one.
On failure:
"No table named ..." means it does not exist under that name. The error lists close matches; try one of those. Do not retry the same name, and do not guess a third spelling. Fall back to search_schema with a description of what the table should contain.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ddl | Yes | ||
| name | Yes | ||
| columns | Yes | ||
| comment | No | ||
| primary_key | No | ||
| schema_name | Yes | ||
| foreign_keys | No | Edges from this table to others. | |
| row_estimate | No | ||
| referenced_by | No | Edges from other tables into this one. | |
| qualified_name | Yes |