Hi hackers,

foreach_current_index returns a 0-based index so
list_length also takes a 0-based index. Perhaps the
check should be  list_length(ind_oids_new) <= pos?
Please find the attached patch.

int pos = foreach_current_index(ind_old);

if (unlikely(list_length(ind_oids_new) < pos))
     elog(ERROR, "list of new indexes too short");
ident_idx_new = list_nth_oid(ind_oids_new, pos);
break;

Regards,
Lakshmi

Attachment: 0001-Off-by-one-in-repack-index-loop.patch
Description: Binary data

Reply via email to