Re: off-by-one in pg_repack index loop - Mailing list pgsql-hackers

From John Naylor
Subject Re: off-by-one in pg_repack index loop
Date
Msg-id CANWCAZZyM8n6MmA-W_3EvTQ6YBiQADVBqDfVwCKi0YAGFzv33w@mail.gmail.com
Whole thread
In response to off-by-one in pg_repack index loop  (Lakshmi N <lakshmin.jhs@gmail.com>)
List pgsql-hackers
On Tue, Apr 14, 2026 at 2:35 PM Lakshmi N <lakshmin.jhs@gmail.com> wrote:
> 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;

If we're going to change this, let's also get rid of the "unlikely",
since it's just a noise word here -- see commit 913ec71d6.

--
John Naylor
Amazon Web Services



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Fix race condition in pg_get_publication_tables with concurrent DROP TABLE
Next
From: John Naylor
Date:
Subject: Re: Inherit regression outputs rows in alternative ordering when run on other table AM than heap