Changes in v14 to Heikki's commits, on top of a plain rebase of
hlinnaka/interrupts-handlers-1 onto 4483697be0e.  For review only; the
v14 patches already contain all of this.

Part 1: RequestAddinInterrupt() restriction (0009)

diff --git a/src/backend/ipc/interrupt.c b/src/backend/ipc/interrupt.c
index 64f701ed829..c8889cb7169 100644
--- a/src/backend/ipc/interrupt.c
+++ b/src/backend/ipc/interrupt.c
@@ -654,12 +654,26 @@ ProcessAuxProcessShutdownInterrupt(void)
 	proc_exit(0);
 }
 
-/* Reserve an interrupt bit for use in an extension */
+/*
+ * Reserve an interrupt bit for use in an extension.
+ *
+ * This must be called from the _PG_init() of a library listed in
+ * shared_preload_libraries.  Every process then loads the libraries in the
+ * same order and gets the same bits, so a bit means the same thing in the
+ * sender and the receiver.  A library loaded later, in just one backend,
+ * could be handed a bit that another backend's library also got.
+ */
 InterruptMask
 RequestAddinInterrupt(void)
 {
 	InterruptMask result;
 
+	if (!process_shared_preload_libraries_in_progress)
+		ereport(ERROR,
+				(errmsg("failed to reserve an interrupt bit"),
+				 errdetail("Interrupt bits must be reserved while initializing modules in \"%s\".",
+						   "shared_preload_libraries")));
+
 	if (nextAddinInterruptBit == END_ADDIN_INTERRUPTS)
 		elog(ERROR, "out of addin interrupt bits");
 

Part 2: everything else (0005 copyright year, the rest in 0009)

diff --git a/contrib/pg_stash_advice/pg_stash_advice.c b/contrib/pg_stash_advice/pg_stash_advice.c
index 79048329f61..76583671c4d 100644
--- a/contrib/pg_stash_advice/pg_stash_advice.c
+++ b/contrib/pg_stash_advice/pg_stash_advice.c
@@ -761,7 +761,6 @@ pgsa_start_worker(void)
 	 * complete. (If we do happen to be in single-user mode, this will error
 	 * out, which is fine.)
 	 */
-	worker.bgw_notify_pid = MyProcPid;
 	if (!RegisterDynamicBackgroundWorker(&worker, &handle))
 		ereport(ERROR,
 				(errcode(ERRCODE_INSUFFICIENT_RESOURCES),
diff --git a/src/backend/commands/copyfromparse.c b/src/backend/commands/copyfromparse.c
index 35abf514489..74dc860ddc8 100644
--- a/src/backend/commands/copyfromparse.c
+++ b/src/backend/commands/copyfromparse.c
@@ -313,7 +313,7 @@ CopyGetData(CopyFromState cstate, void *databuf, int minread, int maxread)
 								 errmsg("unexpected EOF on client connection with an open transaction")));
 
 					if (save_query_cancel_enabled)
-						EnableInterrupt(INTERRUPT_QUERY_CANCEL);
+						ResumeQueryCancelInterrupt();
 
 					/* ... and process it */
 					switch (mtype)
diff --git a/src/backend/commands/repack.c b/src/backend/commands/repack.c
index c68c0250601..75b95f6001d 100644
--- a/src/backend/commands/repack.c
+++ b/src/backend/commands/repack.c
@@ -3903,7 +3903,6 @@ start_repack_decoding_worker(Oid relid)
 	snprintf(bgw.bgw_library_name, MAXPGPATH, "postgres");
 	snprintf(bgw.bgw_function_name, BGW_MAXLEN, "RepackWorkerMain");
 	bgw.bgw_main_arg = UInt32GetDatum(dsm_segment_handle(decoding_worker->seg));
-	bgw.bgw_notify_pid = MyProcPid;
 
 	if (!RegisterDynamicBackgroundWorker(&bgw, &decoding_worker->handle))
 		ereport(ERROR,
diff --git a/src/backend/ipc/interrupt.c b/src/backend/ipc/interrupt.c
index c8889cb7169..ec984dc9ca6 100644
--- a/src/backend/ipc/interrupt.c
+++ b/src/backend/ipc/interrupt.c
@@ -4,7 +4,7 @@
  *	  Inter-process interrupts.
  *
  *
- * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  *
@@ -24,8 +24,8 @@
 
 
 /* Variables for the holdoff mechanism */
-uint32		InterruptHoldoffCount = 0;
-uint32		CritSectionCount = 0;
+volatile uint32 InterruptHoldoffCount = 0;
+volatile uint32 CritSectionCount = 0;
 
 /*
  * Currently installed interrupt handlers
@@ -44,7 +44,7 @@ static WaitEventSet *InterruptWaitSet;
 
 static PendingInterrupts LocalPendingInterrupts;
 PendingInterrupts *MyPendingInterrupts = &LocalPendingInterrupts;
-pg_atomic_uint32 *MyPendingInterruptsFlags = &LocalPendingInterrupts.flags;
+pg_atomic_uint32 *volatile MyPendingInterruptsFlags = &LocalPendingInterrupts.flags;
 const pg_atomic_uint32 ZeroPendingInterruptsFlags;
 
 static int	nextAddinInterruptBit = BEGIN_ADDIN_INTERRUPTS;
@@ -465,9 +465,13 @@ SendInterrupt(InterruptMask interruptMask, ProcNumber pgprocno)
  * Like SendInterrupt, but with a cross-check that the process has the given
  * PID.
  *
- * This acquires ProcArrayLock to ensure atomicity, i.e. that the process
- * doesn't go away while we're about to send the interrupt, so this cannot be
- * used from postmaster.
+ * This holds freeProcsLock while checking the PID and setting the interrupt
+ * bits, so this cannot be used from postmaster.  A process that takes over
+ * the PGPROC slot afterwards must first pop it from a freelist under
+ * freeProcsLock and then clears the pending interrupts in
+ * InitProcess()/InitAuxiliaryProcess(), so the bits either reach the intended
+ * process or are discarded.  (ProcArrayLock wouldn't do: neither ProcKill()
+ * nor InitProcess() holds it when changing 'pid'.)
  *
  * Most interrupts are harmless to send to wrong process, but with others like
  * INTERRUPT_TERMINATE, not so much.
@@ -480,6 +484,7 @@ SendInterruptWithPid(InterruptMask interruptMask, ProcNumber pgprocno, pid_t pid
 {
 	PGPROC	   *proc;
 	bool		found = false;
+	bool		wakeup = false;
 
 	Assert(pgprocno != INVALID_PROC_NUMBER);
 	Assert(pgprocno >= 0);
@@ -487,19 +492,21 @@ SendInterruptWithPid(InterruptMask interruptMask, ProcNumber pgprocno, pid_t pid
 
 	proc = &ProcGlobal->allProcs[pgprocno];
 
-	LWLockAcquire(ProcArrayLock, LW_SHARED);
+	SpinLockAcquire(&ProcGlobal->freeProcsLock);
 	if (proc->pid == pid)
 	{
-
-		/*
-		 * If the process is currently blocked waiting for an interrupt to
-		 * arrive, and the interrupt wasn't already pending, wake it up.
-		 */
-		if (SendOrRaiseInterrupt(&proc->pendingInterrupts, interruptMask))
-			WakeupOtherProc(proc);
+		wakeup = SendOrRaiseInterrupt(&proc->pendingInterrupts, interruptMask);
 		found = true;
 	}
-	LWLockRelease(ProcArrayLock);
+	SpinLockRelease(&ProcGlobal->freeProcsLock);
+
+	/*
+	 * If the process is currently blocked waiting for an interrupt to arrive,
+	 * and the interrupt wasn't already pending, wake it up.  This is done
+	 * after releasing the spinlock; waking the wrong process is harmless.
+	 */
+	if (wakeup)
+		WakeupOtherProc(proc);
 
 	return found;
 }
diff --git a/src/backend/postmaster/bgworker.c b/src/backend/postmaster/bgworker.c
index 3dc5a5654fb..4d123639fea 100644
--- a/src/backend/postmaster/bgworker.c
+++ b/src/backend/postmaster/bgworker.c
@@ -261,16 +261,17 @@ FindRegisteredWorkerBySlotNumber(int slotno)
 	return NULL;
 }
 
-ProcNumber
-GetNotifyProcNumberForRegisteredWorker(RegisteredBgWorker *rw)
+/*
+ * Read the proc number to notify from a bgworker slot.
+ *
+ * This runs in the postmaster, which must not trust shared memory: a corrupt
+ * value would otherwise make SendInterrupt() write outside the PGPROC array.
+ */
+static ProcNumber
+GetSlotNotifyProcNumber(BackgroundWorkerSlot *slot)
 {
-	BackgroundWorkerSlot *slot = &BackgroundWorkerData->slot[rw->rw_shmem_slot];
 	ProcNumber	result;
 
-	/*
-	 * Be extra paranoid and don't trust the memory contents, since this runs
-	 * in the postmaster.
-	 */
 	result = slot->notify_proc_number;
 	if (!(result == INVALID_PROC_NUMBER ||
 		  (result >= 0 && result < MaxBackends + NUM_AUXILIARY_PROCS)))
@@ -282,6 +283,12 @@ GetNotifyProcNumberForRegisteredWorker(RegisteredBgWorker *rw)
 	return result;
 }
 
+ProcNumber
+GetNotifyProcNumberForRegisteredWorker(RegisteredBgWorker *rw)
+{
+	return GetSlotNotifyProcNumber(&BackgroundWorkerData->slot[rw->rw_shmem_slot]);
+}
+
 /*
  * Notice changes to shared memory made by other backends.
  * Accept new worker requests only if allow_new_workers is true.
@@ -400,7 +407,7 @@ BackgroundWorkerStateChange(bool allow_new_workers)
 			 * notify_proc_number and the update of parallel_terminate_count
 			 * complete before the store to in_use.
 			 */
-			notify_proc_number = slot->notify_proc_number;
+			notify_proc_number = GetSlotNotifyProcNumber(slot);
 			if ((slot->worker.bgw_flags & BGWORKER_CLASS_PARALLEL) != 0)
 				BackgroundWorkerData->parallel_terminate_count++;
 			slot->pid = 0;
@@ -516,13 +523,15 @@ void
 ReportBackgroundWorkerPID(RegisteredBgWorker *rw)
 {
 	BackgroundWorkerSlot *slot;
+	ProcNumber	notify_proc_number;
 
 	Assert(rw->rw_shmem_slot < max_worker_processes);
 	slot = &BackgroundWorkerData->slot[rw->rw_shmem_slot];
 	slot->pid = rw->rw_pid;
 
-	if (slot->notify_proc_number != INVALID_PROC_NUMBER)
-		SendInterrupt(INTERRUPT_WAIT_WAKEUP, slot->notify_proc_number);
+	notify_proc_number = GetSlotNotifyProcNumber(slot);
+	if (notify_proc_number != INVALID_PROC_NUMBER)
+		SendInterrupt(INTERRUPT_WAIT_WAKEUP, notify_proc_number);
 }
 
 /*
@@ -543,7 +552,7 @@ ReportBackgroundWorkerExit(RegisteredBgWorker *rw)
 	Assert(rw->rw_shmem_slot < max_worker_processes);
 	slot = &BackgroundWorkerData->slot[rw->rw_shmem_slot];
 	slot->pid = rw->rw_pid;
-	notify_proc_number = slot->notify_proc_number;
+	notify_proc_number = GetSlotNotifyProcNumber(slot);
 
 	/*
 	 * If this worker is slated for deregistration, do that before notifying
@@ -627,7 +636,7 @@ ForgetUnstartedBackgroundWorkers(void)
 			slot->notify_proc_number != INVALID_PROC_NUMBER)
 		{
 			/* ... then zap it, and notify the waiter */
-			ProcNumber	notify_proc_number = slot->notify_proc_number;
+			ProcNumber	notify_proc_number = GetSlotNotifyProcNumber(slot);
 
 			ForgetBackgroundWorker(rw);
 			if (notify_proc_number != INVALID_PROC_NUMBER)
diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c
index 945974c2b1b..2c5e4ef4d58 100644
--- a/src/backend/postmaster/checkpointer.c
+++ b/src/backend/postmaster/checkpointer.c
@@ -13,7 +13,7 @@
  * The normal termination sequence is that checkpointer is instructed to
  * execute the shutdown checkpoint by SIGINT, which raises the
  * INTERRUPT_SHUTDOWN_XLOG interrupt.  After that checkpointer waits
- * to be terminated via SIGUSR2, raising INTERRUP_TERMINATE, which instructs
+ * to be terminated via SIGUSR2, raising INTERRUPT_TERMINATE, which instructs
  * the checkpointer to exit(0).
  * All backends must be stopped before SIGINT or SIGUSR2 is issued!
  *
@@ -219,14 +219,14 @@ CheckpointerMain(const void *startup_data, size_t startup_data_len)
 	/*
 	 * Ignore SIGTERM, because during a standard Unix system shutdown cycle,
 	 * init will SIGTERM all processes at once.  We want to wait for the
-	 * backends to exit, whereupon the postmaster will tell us it's okay to
-	 * shut down (via INTERRUPT_SHUTDOWN_XLOG).
+	 * backends to exit, whereupon the postmaster will tell us to write the
+	 * shutdown checkpoint (SIGINT) and then to exit (SIGUSR2).
 	 */
 	pqsignal(SIGTERM, PG_SIG_IGN);
 
 	/*
 	 * Postmaster uses SIGINT to send us INTERRUPT_SHUTDOWN_XLOG, and SIGUSR2
-	 * for INTERRUP_TERMINATE
+	 * for INTERRUPT_TERMINATE.
 	 */
 	pqsignal(SIGINT, ReqShutdownXLOG);
 	pqsignal(SIGUSR2, SignalHandlerForShutdownRequest);
@@ -620,6 +620,16 @@ CheckpointerMain(const void *startup_data, size_t startup_data_len)
 
 	if (InterruptPending(INTERRUPT_SHUTDOWN_XLOG))
 	{
+		/*
+		 * Stop processing config reloads.  From here on, any
+		 * CHECK_FOR_INTERRUPTS(), including the one in errfinish(), would run
+		 * the reload handler, and if full_page_writes changed it would write
+		 * an XLOG_FPW_CHANGE record: during the shutdown checkpoint that
+		 * PANICs CreateCheckPoint(), and after it WAL insertion is no longer
+		 * allowed.  There is nothing left for a reload to apply.
+		 */
+		DisableInterrupt(INTERRUPT_CONFIG_RELOAD);
+
 		/*
 		 * Close down the database.
 		 *
@@ -816,7 +826,9 @@ CheckpointWriteDelay(int flags, double progress)
 		 * Sleep.
 		 */
 		WaitInterrupt(CheckForInterruptsMask |
-					  INTERRUPT_WAIT_WAKEUP,
+					  INTERRUPT_WAIT_WAKEUP |
+					  INTERRUPT_SHUTDOWN_XLOG |
+					  INTERRUPT_TERMINATE,
 					  WL_INTERRUPT | WL_EXIT_ON_PM_DEATH | WL_TIMEOUT,
 					  100,
 					  WAIT_EVENT_CHECKPOINT_WRITE_DELAY);
diff --git a/src/backend/postmaster/datachecksum_state.c b/src/backend/postmaster/datachecksum_state.c
index f36df37c71f..3ca93b24a8e 100644
--- a/src/backend/postmaster/datachecksum_state.c
+++ b/src/backend/postmaster/datachecksum_state.c
@@ -699,7 +699,6 @@ StartDataChecksumsWorkerLauncher(DataChecksumsWorkerOperation op,
 		snprintf(bgw.bgw_name, BGW_MAXLEN, "datachecksums launcher");
 		snprintf(bgw.bgw_type, BGW_MAXLEN, "datachecksums launcher");
 		bgw.bgw_restart_time = BGW_NEVER_RESTART;
-		bgw.bgw_notify_pid = MyProcPid;
 		bgw.bgw_main_arg = (Datum) 0;
 
 		if (!RegisterDynamicBackgroundWorker(&bgw, &bgw_handle))
@@ -996,7 +995,6 @@ ProcessDatabase(DataChecksumsWorkerDatabase *db)
 	snprintf(bgw.bgw_name, BGW_MAXLEN, "datachecksums worker");
 	snprintf(bgw.bgw_type, BGW_MAXLEN, "datachecksums worker");
 	bgw.bgw_restart_time = BGW_NEVER_RESTART;
-	bgw.bgw_notify_pid = MyProcPid;
 	/* pass the invocation number to the worker process */
 	bgw.bgw_main_arg = UInt64GetDatum(invocation);
 
diff --git a/src/backend/replication/logical/slotsync.c b/src/backend/replication/logical/slotsync.c
index a6b00d8e40c..e821b791cf7 100644
--- a/src/backend/replication/logical/slotsync.c
+++ b/src/backend/replication/logical/slotsync.c
@@ -1690,6 +1690,8 @@ ReplSlotSyncWorkerMain(const void *startup_data, size_t startup_data_len)
 	/* Setup signal handling */
 	pqsignal(SIGFPE, FloatExceptionHandler);
 	SetStandardInterruptHandlers();
+	SetInterruptHandler(INTERRUPT_QUERY_CANCEL, ProcessQueryCancelInterrupt);
+	EnableInterrupt(INTERRUPT_QUERY_CANCEL);
 
 	check_and_set_sync_info(MyProcNumber);
 
diff --git a/src/backend/replication/walsender.c b/src/backend/replication/walsender.c
index ed0e7e45c76..718fc813977 100644
--- a/src/backend/replication/walsender.c
+++ b/src/backend/replication/walsender.c
@@ -836,7 +836,7 @@ HandleUploadManifestPacket(StringInfo buf, off_t *offset,
 				 errmsg("unexpected EOF on client connection with an open transaction")));
 
 	if (save_query_cancel_enabled)
-		EnableInterrupt(INTERRUPT_QUERY_CANCEL);
+		ResumeQueryCancelInterrupt();
 
 	/* Process the message */
 	switch (mtype)
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c
index 053fecedcfa..f4781f86b7b 100644
--- a/src/backend/storage/buffer/bufmgr.c
+++ b/src/backend/storage/buffer/bufmgr.c
@@ -6895,7 +6895,7 @@ cleanup_lock_acquired:
 }
 
 /*
- * Check called from ProcessRecoveryConflictInterrupts() when Startup process
+ * Check called from ProcessRecoveryConflictInterrupt() when Startup process
  * requests cancellation of all pin holders that are blocking it.
  */
 bool
diff --git a/src/backend/storage/ipc/shm_mq.c b/src/backend/storage/ipc/shm_mq.c
index 2607bae9a3b..4b651dbaa30 100644
--- a/src/backend/storage/ipc/shm_mq.c
+++ b/src/backend/storage/ipc/shm_mq.c
@@ -281,8 +281,8 @@ shm_mq_get_sender(shm_mq *mq)
  *
  * If handle != NULL, the queue can be read or written even before the
  * other process has attached.  We'll wait for it to do so if needed.  The
- * handle must be for a background worker initialized with bgw_notify_pid
- * equal to our PID.
+ * handle must be for a background worker that we registered without
+ * BGWORKER_NO_NOTIFY.
  *
  * shm_mq_detach() should be called when done.  This will free the
  * shm_mq_handle and mark the queue itself as detached, so that our
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index e3c1f9567f2..b5e897f4f29 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -499,7 +499,7 @@ SocketBackend(StringInfo inBuf)
 		return EOF;				/* suitable message already logged */
 
 	if (save_query_cancel_enabled)
-		EnableInterrupt(INTERRUPT_QUERY_CANCEL);
+		ResumeQueryCancelInterrupt();
 
 	return qtype;
 }
@@ -3066,7 +3066,8 @@ die(SIGNAL_ARGS)
 	 * Rather ugly, but it's unlikely to be worthwhile to invest much more
 	 * effort just for the benefit of single user mode.
 	 */
-	if (DoingCommandRead && whereToSendOutput != DestRemote)
+	if (DoingCommandRead && whereToSendOutput != DestRemote &&
+		INTERRUPTS_CAN_BE_PROCESSED())
 		ProcessTerminateInterrupt();
 }
 
@@ -3173,6 +3174,23 @@ ProcessRecoveryConflictInterrupt(void)
 	}
 }
 
+/*
+ * Re-enable query cancellation after a section that disabled it while reading
+ * from the client.
+ *
+ * report_recovery_conflict() defers a conflict that arrives while query
+ * cancellation is disabled, leaving it in pendingRecoveryConflicts without
+ * re-raising INTERRUPT_RECOVERY_CONFLICT.  Raise the interrupt here, so that
+ * the next CHECK_FOR_INTERRUPTS() processes it.
+ */
+void
+ResumeQueryCancelInterrupt(void)
+{
+	EnableInterrupt(INTERRUPT_QUERY_CANCEL);
+	if (pg_atomic_read_u32(&MyProc->pendingRecoveryConflicts) != 0)
+		RaiseInterrupt(INTERRUPT_RECOVERY_CONFLICT);
+}
+
 void
 ProcessRecoveryConflict(RecoveryConflictReason reason)
 {
@@ -3337,11 +3355,12 @@ report_recovery_conflict(RecoveryConflictReason reason)
 			if ((EnabledInterruptsMask & INTERRUPT_QUERY_CANCEL) == 0)
 			{
 				/*
-				 * Re-arm and defer this interrupt until later when we're
-				 * prepared to handle query cancellation.
+				 * Defer this conflict until we're prepared to handle query
+				 * cancellation.  ResumeQueryCancelInterrupt() raises the
+				 * interrupt again.  Raising it here would make every
+				 * CHECK_FOR_INTERRUPTS() and every wait return at once.
 				 */
 				(void) pg_atomic_fetch_or_u32(&MyProc->pendingRecoveryConflicts, (1 << reason));
-				RaiseInterrupt(INTERRUPT_RECOVERY_CONFLICT);
 				return;
 			}
 
diff --git a/src/backend/utils/init/miscinit.c b/src/backend/utils/init/miscinit.c
index 64d5943b31f..e964759b426 100644
--- a/src/backend/utils/init/miscinit.c
+++ b/src/backend/utils/init/miscinit.c
@@ -194,7 +194,7 @@ InitStandaloneProcess(const char *argv0)
 
 	/*
 	 * Reset SIGCHLD, in case we were started with it ignored.  See
-	 * InitPostmasterChild.
+	 * SetPostmasterChildSignalHandlers.
 	 */
 	pqsignal(SIGCHLD, PG_SIG_DFL);
 
diff --git a/src/include/ipc/interrupt.h b/src/include/ipc/interrupt.h
index 1372685d547..9f2ca2d8d23 100644
--- a/src/include/ipc/interrupt.h
+++ b/src/include/ipc/interrupt.h
@@ -3,7 +3,7 @@
  * interrupt.h
  *	  Inter-process interrupts
  *
- * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
@@ -191,7 +191,7 @@ extern PGDLLIMPORT InterruptMask EnabledInterruptsMask;
  * allows CHECK_FOR_INTERRUPTS() to follow just this one pointer, and not have
  * to check the holdoff counts separately.
  */
-extern PGDLLIMPORT pg_atomic_uint32 *MyPendingInterruptsFlags;
+extern PGDLLIMPORT pg_atomic_uint32 *volatile MyPendingInterruptsFlags;
 
 /*
  * Check whether any enabled interrupt is pending, without trying to service
@@ -259,8 +259,15 @@ extern void SetInterruptAttentionMask(InterruptMask mask);
  *		Critical section and interrupt holdoff mechanism
  *****************************************************************************/
 
-extern PGDLLIMPORT uint32 InterruptHoldoffCount;
-extern PGDLLIMPORT uint32 CritSectionCount;
+/*
+ * These, and MyPendingInterruptsFlags, are volatile because
+ * handle_sig_alarm() uses HOLD_INTERRUPTS() and RESUME_INTERRUPTS().  The
+ * stores must happen in program order: if the flags pointer were stored
+ * before the counter, a SIGALRM in between would see a zero count and point
+ * MyPendingInterruptsFlags back at the real flags inside a holdoff section.
+ */
+extern PGDLLIMPORT volatile uint32 InterruptHoldoffCount;
+extern PGDLLIMPORT volatile uint32 CritSectionCount;
 
 extern PGDLLIMPORT const pg_atomic_uint32 ZeroPendingInterruptsFlags;
 
diff --git a/src/include/ipc/standard_interrupts.h b/src/include/ipc/standard_interrupts.h
index d405281e998..6e53be369db 100644
--- a/src/include/ipc/standard_interrupts.h
+++ b/src/include/ipc/standard_interrupts.h
@@ -3,7 +3,7 @@
  * standard_interrupts.h
  *	  List of built-in interrupt bits
  *
- * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
@@ -201,7 +201,7 @@ extern void SetStandardInterruptHandlers(void);
 extern void ProcessQueryCancelInterrupt(void);
 extern void ProcessTerminateInterrupt(void);
 extern void ProcessConfigReloadInterrupt(void);
-extern void ProcessRecoveryConflictInterrupts(void);
+extern void ResumeQueryCancelInterrupt(void);
 extern void ProcessTransactionTimeoutInterrupt(void);
 extern void ProcessIdleSessionTimeoutInterrupt(void);
 extern void ProcessIdleInTransactionSessionTimeoutInterrupt(void);
diff --git a/src/tools/pgindent/typedefs.list b/src/tools/pgindent/typedefs.list
index 41f6b7c1aba..6a72d96412b 100644
--- a/src/tools/pgindent/typedefs.list
+++ b/src/tools/pgindent/typedefs.list
@@ -4038,6 +4038,7 @@ pg_getopt_ctx
 pg_gssinfo
 pg_hmac_ctx
 pg_hmac_errno
+pg_interrupt_handler_t
 pg_local_to_utf_combined
 pg_locale_t
 pg_mb_radix_tree
