Re: [PATCH] VACUUM: avoid pre-creation transactions holding back cleanup of newly created relations - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: [PATCH] VACUUM: avoid pre-creation transactions holding back cleanup of newly created relations
Date
Msg-id CAAKRu_YqAgs8A5-TcKcGU1XsRE3ZC5VGmgF3YZuvQgq5V_fBZQ@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] VACUUM: avoid pre-creation transactions holding back cleanup of newly created relations  (Andres Freund <andres@anarazel.de>)
Responses Re: [PATCH] VACUUM: avoid pre-creation transactions holding back cleanup of newly created relations
List pgsql-hackers
On Tue, Dec 9, 2025 at 2:25 PM Andres Freund <andres@anarazel.de> wrote:
>
> Isn't the whole idea that it would be safe to allow freezing in this case
> incorrect?  Consider the following scenario:
>
> A1: BEGIN TRANSACTION ISOLATION LEVEL REPEATABLE READ; SELECT;
> B1: CREATE TABLE foo AS SELECT random();
> B2: VACUUM FREEZE foo;
> A2: SELECT * FROM foo;
>
> If you allowed freezing of the rows in B2, A2 will see the rows as visible,
> despite them not being supposed to be visible.

Is the reason this isn't a problem for COPY FREEZE because the
freezing happens in the same transaction block as creating the table
so A2 wouldn't be able to see the catalog entry for the table?

- Melanie



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [PATCH] VACUUM: avoid pre-creation transactions holding back cleanup of newly created relations
Next
From: Robert Haas
Date:
Subject: Re: pg_plan_advice