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 < [email protected]> 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 >
