pgsql: Fix error message for concurrent repack on materialized views

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix error message for concurrent repack on materialized views
Date: 2026-09-09 10:58:47
Message-ID: E1x4G0s-000000047ZC-0f6v@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix error message for concurrent repack on materialized views

Previously, running REPACK (CONCURRENTLY) on a materialized view failed
with a confusing "has no identity index" error.

REPACK (CONCURRENTLY) replays changes decoded from WAL, but a
materialized view produces none, since it cannot be modified by DML and
REFRESH rewrites it through a transient heap that is not logically
decoded.

Fix this by reporting a clear error for materialized views upfront,
alongside the existing checks for system catalogs and TOAST tables, and
document the limitation.

Author: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Reviewed-by: Kiran Kaki <itskkpg(at)gmail(dot)com>
Backpatch-through: 19
Discussion: https://postgr.es/m/CALj2ACXPvy4_LkQ0nHKgbZjAGK9fkDqRYUvXA3hgwxPm_X7Eng@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/412ef97d925c54d6135afb4c22cceccb6421d8a2

Modified Files
--------------
contrib/test_decoding/expected/repack.out | 6 ++++++
contrib/test_decoding/sql/repack.sql | 5 +++++
doc/src/sgml/ref/repack.sgml | 6 ++++++
src/backend/commands/repack.c | 8 ++++++++
4 files changed, 25 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2026-09-09 15:34:50 pgsql: Fix concurrency issues with DROP TABLESPACE
Previous Message Álvaro Herrera 2026-09-09 09:11:21 pgsql: Remove stale XXX comment in logical launcher