Skip to content

Commit 8e4fe3b

Browse files
committed
Do a CHECK_FOR_INTERRUPTS after emitting a message of less than ERROR
severity. This is to ensure the user can cancel a query that's spitting out lots of notice/warning messages, even if they're coming from a loop that doesn't otherwise contain a CHECK_FOR_INTERRUPTS. Per gripe from Stephen Frost.
1 parent e69c09c commit 8e4fe3b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/backend/utils/error/elog.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*
4343
*
4444
* IDENTIFICATION
45-
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.174 2006/09/27 18:40:09 tgl Exp $
45+
* $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.175 2006/10/01 22:08:18 tgl Exp $
4646
*
4747
*-------------------------------------------------------------------------
4848
*/
@@ -451,7 +451,14 @@ errfinish(int dummy,...)
451451
abort();
452452
}
453453

454-
/* We reach here if elevel <= WARNING. OK to return to caller. */
454+
/*
455+
* We reach here if elevel <= WARNING. OK to return to caller.
456+
*
457+
* But check for cancel/die interrupt first --- this is so that the user
458+
* can stop a query emitting tons of notice or warning messages, even if
459+
* it's in a loop that otherwise fails to check for interrupts.
460+
*/
461+
CHECK_FOR_INTERRUPTS();
455462
}
456463

457464

0 commit comments

Comments
 (0)