Maintenance actions
pocketPG can run VACUUM, ANALYZE, and REINDEX against specific tables or indexes. These are the only three commands allowed — no arbitrary SQL is executed.
Access
Admin-only: instance owners and admin-role members can run maintenance. Viewer-role members get HTTP 403.
How it works
- Click a VACUUM, ANALYZE, or REINDEX button in the Vacuum & Bloat or Indexes tab.
- A confirmation modal shows exactly what will run.
- SQL is constructed entirely server-side from typed fields (schema, table, index name). User-supplied SQL strings are never executed.
- All identifiers are double-quote escaped to handle mixed-case names, hyphens, and reserved words.
- REINDEX uses
CONCURRENTLYto avoid blocking writes. - On success, the bloat, indexes, and health server-side caches are invalidated so the next tab load shows fresh data.
Requirements
All connections use autocommit = True, which is required — VACUUM and ANALYZE are utility commands that cannot run inside a transaction block.