pgsql: Disallow REPACK (CONCURRENTLY) when replica identity index is dr

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Disallow REPACK (CONCURRENTLY) when replica identity index is dr
Date: 2026-09-11 11:44:35
Message-ID: E1x4zgI-00000004QkG-1Pyl@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Disallow REPACK (CONCURRENTLY) when replica identity index is dropped

The replica identity determination was "flawed": it fell back to the
primary key if the marked index was dropped, which is a defensible
choice, but logical decoding has a differing opinion and fails to
provide usable tuple identity data in this case. "Fix" REPACK by
refusing to use the primary key in that case.

This is arguably broken behavior in RelationGetIndexList, but I'll
refrain from changing that at this stage.

Reported-by: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Author: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>
Author: Ewan Young <kdbase(dot)hack(at)gmail(dot)com>
Backpatch-through: 19
Discussion: https://postgr.es/m/apCBRKCH8jwKiaSY@nathan

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c1c5d28f4a2df9d83ca1bcd6bcd6ed8ca065791b

Modified Files
--------------
contrib/test_decoding/expected/repack.out | 10 ++++++++++
contrib/test_decoding/sql/repack.sql | 9 +++++++++
src/backend/commands/repack.c | 10 ++++------
src/backend/utils/cache/relcache.c | 7 +++++++
4 files changed, 30 insertions(+), 6 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2026-09-11 15:38:22 pgsql: Revert "Support more object types within CREATE SCHEMA".
Previous Message Amit Kapila 2026-09-11 09:57:15 pgsql: Fix crash on UPDATE or DELETE of a partition pending detach.