| From: | Kiran Kaki <itskkpg(at)gmail(dot)com> |
|---|---|
| To: | Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com> |
| Cc: | PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Álvaro Herrera <alvherre(at)kurilemu(dot)de>, Nathan Bossart <nathandbossart(at)gmail(dot)com> |
| Subject: | Re: REPACK (CONCURRENTLY) fails with wrong error for materialized views |
| Date: | 2026-08-29 20:42:37 |
| Message-ID: | CAD0dvCTH+XXbH5nkvj1r9eAwH2Cr5kT__3zFOygQ7c8PFTnEzA@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Bharath,
I verified the change, and it works as intended. The new check is
appropriately placed before replica identity validation. The error is much
clearer than the previous "has no identity index" message, and the
documentation update looks good to me.
*My only suggestion is to add an automated* test as it can help catch any
future regressions in this behavior.
*Verified Upstream Commit* - ec13f71049cda06ea55a67783b822d98824f4d15
*Build Status -* Successfully built with assertions enabled. No relevant
compiler warnings were observed.
*Automated Tests Validation -* The complete test suite passed which
includes the related wal level tests.
*Manual Verifications - *Verified that REPACK (CONCURRENTLY) succeeded on
a regular table and preserved all rows. For both populated and unpopulated
materialized views, it returned the expected error and the new
materialized-view-specific hint that you introduced.
Thanks,
Kiran Kaki.
On Sat, Aug 29, 2026 at 8:58 AM Bharath Rupireddy <
bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> Hi,
>
> 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.
>
> Thoughts?
>
> [1]
> postgres=# CREATE MATERIALIZED VIEW m AS SELECT 1 AS a;
> SELECT 1
> postgres=# REPACK (CONCURRENTLY) m;
> ERROR: cannot execute REPACK (CONCURRENTLY) on relation "m"
> HINT: Relation "m" has no identity index.
>
> --
> Bharath Rupireddy
> Amazon Web Services: https://aws.amazon.com
>
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Zsolt Parragi | 2026-08-29 21:21:38 | REPACK: warn about skipping foreign partitions |
| Previous Message | Andrew Jackson | 2026-08-29 20:31:54 | Add PAM Tests and Option For Custom PAM Config Location |