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