Re: on 19beta3: repack (concurrently) affects sessions with transaction isolation level repeatable read

From: Peter Geoghegan <pg(at)bowt(dot)ie>
To: Jochen Bandhauer <jb(at)jbitc(dot)de>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: on 19beta3: repack (concurrently) affects sessions with transaction isolation level repeatable read
Date: 2026-08-22 19:45:07
Message-ID: CAH2-WzmgX2suoXeyOhT6zp01qtosoo6x2kHxDNPJNcn=Kc3Jwg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sat, Aug 22, 2026 at 3:29 AM Jochen Bandhauer <jb(at)jbitc(dot)de> wrote:
> while using repack (concurrently) I found a behavior that I didn't
> expect. When running a "repack (concurrently) t;" in one session,
> another session with "transaction isolation level repeatable read"
> reports sometimes 0 for "select count(*) from t;".

This is a documented behavior; "repack concurrently" is allowed to
violate MVCC. There's a warning box about this in the docs for the
repack command [1], which notes "REPACK with the CONCURRENTLY option
is not MVCC-safe, see Section 13.6 for details".

[1] https://www.postgresql.org/docs/devel/sql-repack.html
--
Peter Geoghegan

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Peter Geoghegan 2026-08-22 20:29:48 Re: BTree index corruption (heap-tid-past-end, unexpected zero page, misplaced TID in posting list) recurring on high-churn tables, PG 18.3, data_checksums=on, no preceding crash
Previous Message mostafa nabil 2026-08-22 14:54:19 Re: BUG #19628: Uninterruptible vacuum during hash index processing