Allow single table VACUUM in transaction block

From: Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Allow single table VACUUM in transaction block
Date: 2022-10-27 09:31:31
Message-ID: CANbhV-EGkXfWymABGyNo0ZiwOW8=QZ84CmTrYSNSUq1-XbBC7g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

It is a common user annoyance to have a script fail because someone
added a VACUUM, especially when using --single-transaction option.
Fix, so that this works without issue:

BEGIN;
....
VACUUM (ANALYZE) vactst;
....
COMMIT;

Allows both ANALYZE and vacuum of toast tables, but not VACUUM FULL.

When in a xact block, we do not set PROC_IN_VACUUM,
nor update datfrozenxid.

Tests, docs.

--
Simon Riggs http://www.EnterpriseDB.com/

Attachment Content-Type Size
single_table_vacuum.v1.patch application/octet-stream 11.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Guo 2022-10-27 10:06:45 Avoid using list_delete_first in simplify_or/and_arguments
Previous Message Bharath Rupireddy 2022-10-27 09:28:08 Re: Add LSN along with offset to error messages reported for WAL file read/write/validate header failures