diff --git a/src/backend/executor/nodeModifyTable.c b/src/backend/executor/nodeModifyTable.c index 1c254257a2c..0fe4226b434 100644 --- a/src/backend/executor/nodeModifyTable.c +++ b/src/backend/executor/nodeModifyTable.c @@ -446,9 +446,11 @@ ExecInsert(ModifyTableState *mtstate, * * We loop back here if we find a conflict below, either during * the pre-check, or when we re-check after inserting the tuple - * speculatively. + * speculatively. Better allow interrupts in case some bug makes + * this an infinite loop. */ vlock: + CHECK_FOR_INTERRUPTS(); specConflict = false; if (!ExecCheckIndexConstraints(slot, estate, &conflictTid, arbiterIndexes))