From 4b3d55df85ec09a7c11c28f2aba331a67b9502b9 Mon Sep 17 00:00:00 2001 From: Julien Rouhaud Date: Fri, 22 Jan 2021 20:48:32 +0800 Subject: [PATCH] Check for interrupts in the oid generator loop. As this loop can take a significant amount of time to find a suitable oid in some extreme case, it's important to make sure that the query is cancellable. --- hypopg.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hypopg.c b/hypopg.c index 2442410..edbb529 100644 --- a/hypopg.c +++ b/hypopg.c @@ -24,6 +24,7 @@ #include "utils/lsyscache.h" #endif #include "executor/spi.h" +#include "miscadmin.h" #include "utils/elog.h" #include "include/hypopg.h" @@ -229,6 +230,8 @@ hypo_getNewOid(Oid relid) while(!OidIsValid(newoid)) { + CHECK_FOR_INTERRUPTS(); + if (!OidIsValid(last_oid)) newoid = last_oid = min_fake_oid; else