Table Information
db_table_infoGet detailed information about a specific table, including exact row count, columns, indexes, foreign keys, and size. Use to drill down after an overview or before writing performance-sensitive queries.
Instructions
Returns detailed information about a single table: exact row count (via COUNT(*)), all columns with their types and nullability, all indexes with their columns and uniqueness, foreign key relationships, and approximate table size on disk. Use this when you need specifics about one table that go beyond the overview.
When to use:
After db_overview, to drill into a specific table's details.
When the user asks "Tell me about the orders table" or "What indexes does users have?"
Before writing performance-sensitive queries, to understand available indexes.
When debugging issues related to a specific table.
Behavioral notes:
Row count is exact (uses COUNT(*)), which may be slow on very large tables.
The table name must exist in the database — a typo returns a clear error with suggestions from the schema.
Table size is approximate, based on pg_table_size().
Returns: JSON with row_count, columns array, indexes array, foreign_keys, and size_bytes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | Yes | Name of the table to query | |
| database | No | Name of the database to query (from pgautopilot.json). Omit to use the current default database. |