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 <[email protected]>
Author: Matthias van de Meent <[email protected]>
Author: Ewan Young <[email protected]>
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(-)

Reply via email to