Rollback Plan

Follow these rollback steps to quickly recover if something fails, or goes wrong during or after the run

  • Restore Autovacuum Settings:
    The idspgmaint utility resets temporary autovacuum changes on exit. If interrupted, re-enable autovacuum on affected tables:
    ALTER TABLE idsldap.table RESET (autovacuum_enabled);
  • Restore Connection Settings:
    Normally, idspgmaint resets connections after VACUUM FULL. If it fails in exclusive mode, unblock connections with:
    ALTER DATABASE idsldap WITH CONNECTION LIMIT -1;
    GRANT CONNECT ON DATABASE idsldap TO PUBLIC;
  • Rebuild Indexes if Interrupted:
    Partially completed REINDEX may leave invalid indexes. Check for them:
    SELECT schemaname, relname, indexrelname FROM pg_stat_all_indexes WHERE NOT indisvalid;
    Rebuild invalid indexes:
    REINDEX INDEX index_name;
    If REINDEX fails, drop the invalid indexes:
    DROP INDEX index_name;
  • Re-run ANALYZE:
    If ANALYZE did not finish, run-
    ANALYZE VERBOSE;
  • Restore from Backup (Last Resort):

    If corruption or major failure occurs:

    1. Stop the application.

    2. Restore from the latest physical backup or pg_basebackup snapshot.

    3. Apply WAL files if using Point-In-Time Recovery (PITR).