Destructive Operations
VACUUM FULL
VACUUM FULL orders; What this does
Rewrites the entire table to reclaim space, holding ACCESS EXCLUSIVE for the full duration. Unlike plain VACUUM (SHARE UPDATE EXCLUSIVE, non-blocking), FULL blocks all reads and writes.
Safe rewrite
Use pg_repack for an online table rewrite that does not hold ACCESS EXCLUSIVE
-- pg_repack --table orders --no-superuser-check