Re: off-by-one in pg_repack index loop

From: John Naylor <johncnaylorls(at)gmail(dot)com>
To: Lakshmi N <lakshmin(dot)jhs(at)gmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: off-by-one in pg_repack index loop
Date: 2026-04-29 07:16:08
Message-ID: CANWCAZZyM8n6MmA-W_3EvTQ6YBiQADVBqDfVwCKi0YAGFzv33w@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 14, 2026 at 2:35 PM Lakshmi N <lakshmin(dot)jhs(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2026-04-29 07:49:16 Re: Inherit regression outputs rows in alternative ordering when run on other table AM than heap
Previous Message Bharath Rupireddy 2026-04-29 07:15:00 Re: Fix race condition in pg_get_publication_tables with concurrent DROP TABLE