Skip to main content

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

  1. Click a VACUUM, ANALYZE, or REINDEX button in the Vacuum & Bloat or Indexes tab.
  2. A confirmation modal shows exactly what will run.
  3. SQL is constructed entirely server-side from typed fields (schema, table, index name). User-supplied SQL strings are never executed.
  4. All identifiers are double-quote escaped to handle mixed-case names, hyphens, and reserved words.
  5. REINDEX uses CONCURRENTLY to avoid blocking writes.
  6. 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.