diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c index b22ea3deb68..382112c727c 100644 --- a/src/backend/tcop/postgres.c +++ b/src/backend/tcop/postgres.c @@ -2488,6 +2488,13 @@ quickdie(SIGNAL_ARGS) { PG_SETMASK(&BlockSig); + /* + * Prevent interrupts while exiting; though we just blocked signals that + * would queue new interrupts, one may have been pending. We don't want a + * quickdie() downgraded to a mere query cancel. + */ + HOLD_INTERRUPTS(); + /* * Ideally this should be ereport(FATAL), but then we'd not get control * back...