Re: REPACK (CONCURRENTLY) fails with wrong error for materialized views

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Nathan Bossart <nathandbossart(at)gmail(dot)com>, Kiran Kaki <itskkpg(at)gmail(dot)com>
Subject: Re: REPACK (CONCURRENTLY) fails with wrong error for materialized views
Date: 2026-08-31 20:50:34
Message-ID: CALj2ACXQB2JeJmaCLAdxS9Lw3ffA8SPod62Rqqoo6ofPg3ETBQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Mon, Aug 31, 2026 at 1:41 PM Álvaro Herrera <alvherre(at)kurilemu(dot)de> wrote:
>
> On 2026-Aug-29, Bharath Rupireddy wrote:
>
> > REPACK (CONCURRENTLY) fails with a confusing "no identity index" error
> > when a materialized view is specified. Please find attached a patch
> > that reports a proper error, similar to the other cases in
> > check_concurrent_repack_requirements(), and adds a note to the docs. I
> > think this needs to be backpatched to PG19.
>
> I think this should reuse errdetail_relkind_not_supported().

Yes, that's better, let's reuse.

> I would
> add a trivial test as Kiran Kaki suggested though.

That's fine with me, I can add one for materialized views here in this
patch. Going by this, I think we also need tests for catalogs, TOAST,
and other repack-restricted cases. I'd let Kiran Kaki add such tests
in a new thread.

Thoughts?

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul A Jungwirth 2026-08-31 20:55:51 Temporal foreign key actions
Previous Message Bharath Rupireddy 2026-08-31 20:47:00 Re: [PATCH] Release replication slot on error in SQL-callable slot functions