pg_describe
Inspect PostgreSQL schema: list tables, views, and materialized views with row counts, or describe columns, types, keys, and comments for a specific table. Avoid manual information_schema queries.
Instructions
Inspect the database schema.
Call with no arguments to list the tables, views and materialized views in the configured search path, with their estimated row counts and comments. Call with "table" to list that relation's columns, types, nullability, defaults, primary keys and comments.
Prefer this over querying information_schema by hand: it is faster and reports partitioned tables and comments correctly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| table | No | Table or view name. Omit to list all relations in the search path. | |
| schema | No | Restrict to a single schema. Defaults to the configured search path. |