pgsql: Fail REPACK in presence of invalid indexes, take 2

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fail REPACK in presence of invalid indexes, take 2
Date: 2026-09-15 15:19:45
Message-ID: E1x6Uwj-00000000SXv-2hGY@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fail REPACK in presence of invalid indexes, take 2

Commit 0c5d6269614e was confused about which indexes are potentially
problematic to rebuild: we thought only !indisready indexes could fail
to rebuild, and thus would attempt to rebuild !indisvalid ones that are
"ready" (that is, being maintained by DML but not yet completed).
However, that's wrong, because it could be that the validation phase of
such an index failed or was interrupted partway through. So, have
REPACK throw an error with all !indisvalid indexes, not just those
!indisready.

(!indisready implies !indisvalid, so this is an expansion of what
happened with the previous commit.)

Reported-by: shihao zhong <zhong950419(at)gmail(dot)com>
Backpatch-through: 19
Discussion: https://postgr.es/m/CAGRkXqRA4YetT8Nu3+1-45+ffTwi2bd1d1eDFME39Y9OPRMytQ@mail.gmail.com

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0cabab44f12f4169e52a0ba61d810dd2801cd517

Modified Files
--------------
doc/src/sgml/ref/repack.sgml | 6 ++++++
src/backend/commands/repack.c | 15 ++++++++-------
2 files changed, 14 insertions(+), 7 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2026-09-15 15:23:12 Re: pgsql: Fail REPACK in presence of invalid indexes, take 2
Previous Message Peter Geoghegan 2026-09-15 15:19:42 pgsql: Add slot-based table AM index scan interface.