Re: REPACK (CONCURRENTLY) doesn't check the table AM

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Cc: Nathan Bossart <nathandbossart(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org, alvherre(at)kurilemu(dot)de
Subject: Re: REPACK (CONCURRENTLY) doesn't check the table AM
Date: 2026-08-27 20:45:00
Message-ID: CALj2ACVJhM3OARtD_eSVVn9KDCpyNUTipEAzkZnO1idMEFEcFQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Thu, Aug 27, 2026 at 12:57 PM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
>
> > If the table AM doesn't support logical decoding, concurrent repack
> > would silently lose some table data as it misses the changes
> > happened during the rewrites.
>
> Yes, that's correct. I came to the same conclusion.
>
> > I think we should have the check for it.
> > One idea would be to have a new table AM callback returning true if
> > the table AM supports concurrent repack (i.e., its rmgr provides
> > rm_decode callback), but I think it's not the right time to introduce
> > a new table AM callback.
>
> Agreed. Adding a new table AM callback needs consensus and is time
> consuming. Perhaps we can try for HEAD based on field reports that
> require the concurrent repack feature for non-heap table AMs.
>
> > So restricting it to heap for v19 seems fine
> > to me.
>
> +1. I will send a patch soon.

Please find the attached patch. I didn't add a test, I don't think we need one.

--
Bharath Rupireddy
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v1-0001-Restrict-concurrent-repack-to-the-heap-access-met.patch application/x-patch 2.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2026-08-27 20:50:27 Re: REPACK (CONCURRENTLY) fails when table owner lacks CONNECT
Previous Message Robert Haas 2026-08-27 20:40:56 Re: MERGE/SPLIT PARTITIONS issues/questions