Add a CHECK_FOR_INTERRUPTS() in _bt_buildadd(). This fixes problem
authorTom Lane
Fri, 10 Mar 2006 20:18:15 +0000 (20:18 +0000)
committerTom Lane
Fri, 10 Mar 2006 20:18:15 +0000 (20:18 +0000)
with not responding to query cancel during the last stage of btree index
creation.

src/backend/access/nbtree/nbtsort.c

index b55c0c99047ddc5fc26b95d08e0f3e69bb3e12b6..0825c0ef25727d2f3fe35075ce6aaa33530d52a7 100644 (file)
@@ -56,7 +56,7 @@
  * Portions Copyright (c) 1994, Regents of the University of California
  *
  * IDENTIFICATION
- *   $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.99 2006/03/05 15:58:21 momjian Exp $
+ *   $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.100 2006/03/10 20:18:15 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -461,6 +461,12 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, IndexTuple itup)
    Size        pgspc;
    Size        itupsz;
 
+   /*
+    * This is a handy place to check for cancel interrupts during the
+    * btree load phase of index creation.
+    */
+   CHECK_FOR_INTERRUPTS();
+
    npage = state->btps_page;
    nblkno = state->btps_blkno;
    last_off = state->btps_lastoff;