Check for interrupts during non-fast-update GIN insertion

ginExtractEntries() can produce a lot of entries for a single item.
During index build, we check for interrupts between entries, and the
fast-update codepath does it as part of vacuum_delay_point(), but the
non-fast update insertion codepath was uninterruptible. Add
CHECK_FOR_INTERRUPTS() between entries in the non-fast update codepath
too.

Author: Vinod Sridharan <vsridh90@gmail.com>
Discussion: https://www.postgresql.org/message-id/CAFMdLD6mQvAuStiOGvBJxAEfo6wdjZhj3+JveTLxOX8MVn4zmA@mail.gmail.com
This commit is contained in:
Heikki Linnakangas 2026-03-13 15:12:32 +02:00
parent fa6f2f624c
commit 2e1dcf8c54

View file

@ -850,8 +850,12 @@ ginHeapTupleInsert(GinState *ginstate, OffsetNumber attnum,
&nentries, &categories);
for (i = 0; i < nentries; i++)
{
/* there could be many entries, so be willing to abort here */
CHECK_FOR_INTERRUPTS();
ginEntryInsert(ginstate, attnum, entries[i], categories[i],
item, 1, NULL);
}
}
bool