diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c index c3e783a8ca..ea51f6d0cc 100644 --- a/src/backend/commands/async.c +++ b/src/backend/commands/async.c @@ -2090,7 +2090,10 @@ ProcessIncomingNotify(void) { bool catchup_enabled; - /* Do nothing if we aren't actively listening */ + /* We *must* reset the flag */ + notifyInterruptOccurred = 0; + + /* Do nothing else if we aren't actively listening */ if (listenChannels == NIL) return; @@ -2102,8 +2105,6 @@ ProcessIncomingNotify(void) set_ps_display("notify interrupt", false); - notifyInterruptOccurred = 0; - /* * We must run asyncQueueReadAllNotifications inside a transaction, else * bad things happen if it gets an error.