]> granicus.if.org Git - postgresql/commitdiff
Do a CHECK_FOR_INTERRUPTS after emitting a message of less than ERROR
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 1 Oct 2006 22:08:18 +0000 (22:08 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 1 Oct 2006 22:08:18 +0000 (22:08 +0000)
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.

src/backend/utils/error/elog.c

index 2aff7f790aa1520e3bd8f2f4f8ee3c94d3074825..61c413b4be32f8719cdb8ec39a72f3e4f9c7a166 100644 (file)
@@ -42,7 +42,7 @@
  *
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.174 2006/09/27 18:40:09 tgl Exp $
+ *       $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.175 2006/10/01 22:08:18 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -451,7 +451,14 @@ errfinish(int dummy,...)
                abort();
        }
 
-       /* We reach here if elevel <= WARNING. OK to return to caller. */
+       /*
+        * We reach here if elevel <= WARNING. OK to return to caller.
+        *
+        * But check for cancel/die interrupt first --- this is so that the user
+        * can stop a query emitting tons of notice or warning messages, even if
+        * it's in a loop that otherwise fails to check for interrupts.
+        */
+       CHECK_FOR_INTERRUPTS();
 }