Re: REPACK (CONCURRENTLY) can lose data in pg_dump output - Mailing list pgsql-hackers

From Thom Brown
Subject Re: REPACK (CONCURRENTLY) can lose data in pg_dump output
Date
Msg-id CAA-aLv6dq1FiC3TOtP6V+sLCnUiRzpcOKi-WApnbXkR2JTgsZA@mail.gmail.com
Whole thread
In response to Re: REPACK (CONCURRENTLY) can lose data in pg_dump output  (Sami Imseih <samimseih.pg@gmail.com>)
List pgsql-hackers
On Fri, 25 Sept 2026 at 20:50, Sami Imseih <samimseih.pg@gmail.com> wrote:
>
> Hi,
>
> > I realise REPACK (CONCURRENTLY) is documented as not being MVCC-safe,
> > Should this at least be documented on the pg_dump page, or could [...]
>
> Yeah, this is expected and not specifically introduced by REPACK. Any
> command that rewrites the table will also store the rows with a new
> xmin, so these rows are now not visible to a transaction that has a
> snapshot that pre-dates the rewrite. pg_dump runs in REPEATABLE READ
> isolation level and has a transaction snapshot, so it will not see the
> rewritten rows. A query inside a STABLE/IMMUTABLE function even when run
> through a READ COMMITTED transaction will also have the same behavior.
>
> You can repro the same behavior with an ALTER TABLE...ALTER COLUMN:

Ah, of course, I guess I was so focused on finding data loss that I
neglected to consider the pre-existing gaps.

Thanks for pointing that out.

Thom



pgsql-hackers by date:

Previous
From: Alexandre Felipe
Date:
Subject: Re: FIX: BUG #19687: ALTER SEQUENCE missing lock
Next
From: Ayush Tiwari
Date:
Subject: Re: FIX: BUG #19687: ALTER SEQUENCE missing lock