pg_adm
pg_adm · A PostgreSQL extension providing some administrative tools.
Overview
PostgreSQL · 10, 11, 12, 13, 14, 15, 16, 17, 18
| Relationships | |
|---|---|
| Requires | pg_buffercache |
Usage
Sources:
pg_adm version 0.0.1 packages a broad collection of PostgreSQL administration queries as views and functions in the fixed adm schema. Use it for interactive inspection of size, bloat, indexes, buffers, dependencies, grants, and extension objects; review every mutating helper before allowing routine users to execute it.
Core Workflow
The extension requires pg_buffercache, which PostgreSQL installs automatically when the dependency is available.
Planner statistics and cumulative statistics drive several reports, so their results are estimates or observations rather than proof that an object is safe to remove.
Important Objects
- Size views include
size_databases,size_schemas,size_tables, andsize_relations_biggest. - Bloat and statistics views include
table_bloat,btree_bloat,no_stats, andbuffers_breakdown. - Index diagnostics include
index_summary,index_duplicates,index_size_usage, andunindexed_foreign_keys. dependency_tree(...)anddependencyinspect object dependencies.extension_objectslists objects owned by installed extensions.explain_count_estimate(text)estimates a query’s row count from its plan.clone_schema(...)andgrant_on_tables(...)change database state and privileges.
The extension is non-relocatable and always uses adm. Access should be granted object by object: some views expose cluster metadata, while helpers such as schema cloning and bulk grants can create objects or change privileges. Bloat, duplicate-index, and unused-index reports require administrator judgment and should not be wired directly to automated drops.