agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Álvaro Herrera <alvherre@kurilemu.de>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix error message for concurrent repack on materialized views
Date: Wed, 09 Sep 2026 10:58:47 +0000
Message-ID: <E1x4G0s-000000047ZE-0jgw@gemulon.postgresql.org> (raw)

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.rupireddyforpostgres@gmail.com>
Reviewed-by: Kiran Kaki <itskkpg@gmail.com>
Backpatch-through: 19
Discussion: https://postgr.es/m/CALj2ACXPvy4_LkQ0nHKgbZjAGK9fkDqRYUvXA3hgwxPm_X7Eng@mail.gmail.com

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/40d811540a589cbddeb0736966f2541088134163

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(+)



view thread (2+ messages)

Message-ID: <E1x4G0s-000000047ZE-0jgw@gemulon.postgresql.org>
Permalink:  ../E1x4G0s-000000047ZE-0jgw@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1x4G0s-000000047ZE-0jgw@gemulon.postgresql.org

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: alvherre@kurilemu.de, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix error message for concurrent repack on materialized views
  In-Reply-To: <E1x4G0s-000000047ZE-0jgw@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox