pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jochen Bandhauer <jb@jbitc.de>
To: Peter Geoghegan <pg@bowt.ie>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: on 19beta3: repack (concurrently) affects sessions with transaction isolation level repeatable read
Date: Sun, 23 Aug 2026 11:31:08 +0200
Message-ID: <0865e13a-da93-4ad1-8b93-7b54a1628f04@jbitc.de> (raw)
In-Reply-To: <CAH2-WzmgX2suoXeyOhT6zp01qtosoo6x2kHxDNPJNcn=Kc3Jwg@mail.gmail.com>
References: <5d2060d5-8145-40c6-9a2e-4ddb9f6b0fc9@jbitc.de>
	<CAH2-WzmgX2suoXeyOhT6zp01qtosoo6x2kHxDNPJNcn=Kc3Jwg@mail.gmail.com>

On 22.08.2026 21:45, Peter Geoghegan wrote:
> On Sat, Aug 22, 2026 at 3:29 AM Jochen Bandhauer <jb@jbitc.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
Hello,

thanks, I haven't seen that. I also read that this might change in the 
future [1]. After some further reading I applied patch [2] that worked 
for the test case (The second session always showed the correct number 
of rows).

Jochen

[1] 
https://www.postgresql.org/message-id/202504040733.ysuy5gad55md%40alvherre.pgsql
[2] https://commitfest.postgresql.org/patch/6957/

-- 
Mit freundlichen Grüßen

Jochen Bandhauer
+49 (0)176 29390012
www.jbitc.de

Attachments:

  [text/vcard] jb.vcf (202B, ../0865e13a-da93-4ad1-8b93-7b54a1628f04@jbitc.de/2-jb.vcf)
  download | inline:
BEGIN:VCARD
VERSION:4.0
N:Bandhauer;Jochen;;;
FN:Jochen Bandhauer
EMAIL;PREF=1;TYPE=work:jb@jbitc.de
URL:https://www.jbitc.de
TEL;TYPE=work;VALUE=TEXT:+4917629390012
TZ:Europe/Berlin
END:VCARD

view thread (3+ messages)

Message-ID: <0865e13a-da93-4ad1-8b93-7b54a1628f04@jbitc.de>
Permalink:  ../0865e13a-da93-4ad1-8b93-7b54a1628f04@jbitc.de/
Also on:    postgresql.org/message-id/0865e13a-da93-4ad1-8b93-7b54a1628f04@jbitc.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: jb@jbitc.de, pg@bowt.ie, pgsql-bugs@lists.postgresql.org
  Subject: Re: on 19beta3: repack (concurrently) affects sessions with transaction isolation level repeatable read
  In-Reply-To: <0865e13a-da93-4ad1-8b93-7b54a1628f04@jbitc.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox