Re: Allow single table VACUUM in transaction block

From: Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Allow single table VACUUM in transaction block
Date: 2022-11-01 23:56:17
Message-ID: CANbhV-HjMsR90Nh0Z6KfEJK0CdxRKZPZCSVqq=41veZ0Dtqf9w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 27 Oct 2022 at 21:07, Justin Pryzby <pryzby(at)telsasoft(dot)com> wrote:
>
> On Thu, Oct 27, 2022 at 10:31:31AM +0100, Simon Riggs wrote:
> > Allows both ANALYZE and vacuum of toast tables, but not VACUUM FULL.
>
> Maybe I misunderstood what you meant: you said "not VACUUM FULL", but
> with your patch, that works:
>
> postgres=# begin; VACUUM FULL pg_class; commit;
> BEGIN
> VACUUM
> COMMIT
>
> Actually, I've thought before that it was bit weird that CLUSTER can be
> run within a transaction, but VACUUM FULL cannot (even though it does a
> CLUSTER behind the scenes). VACUUM FULL can process multiple relations,
> whereas CLUSTER can't, but it seems nice to allow vacuum full for the
> case of a single relation.
>
> I haven't checked the rest of the patch, but +1 for allowing VACUUM FULL
> within a user txn.

My intention was to prevent that. I am certainly quite uneasy about
changing anything related to CLUSTER/VF, since they are old, complex
and bug prone.

So for now, I will block VF, as was my original intent.

I will be guided by what others think... so you may yet get your wish.

> Maybe the error message needs to be qualified "...when multiple
> relations are specified".
>
> ERROR: VACUUM cannot run inside a transaction block

Hmm, that is standard wording based on the statement type, but I can
set a CONTEXT message also. Will update accordingly.

Thanks for your input.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2022-11-01 23:57:03 Re: Collation version tracking for macOS
Previous Message vignesh C 2022-11-01 23:43:29 Re: Support logical replication of DDLs