Skip to content

Schema ​

bash
pgembed schema app                          # tables and views, with row estimates and sizes
pgembed schema app books                    # one table: columns, keys, indexes, constraints
pgembed schema app "sales.*"                # every table in sales
pgembed schema app books --json             # structured, for scripts and tools
snippet source | anchor

For a table, schema shows its columns (type, nullability, default, identity, generated, primary key), its indexes, and its constraints with foreign key targets. --json gives one structured document per table, for scripts and tools.

The same descriptions work as psql-style commands, in the interactive prompt and as one-shot SQL:

bash
pgembed sql app "\d books"
pgembed sql app "\dt sales.*"
snippet source | anchor

Released under the MIT License.