diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-10 20:18:15 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-10 20:18:15 +0000 |
commit | 9f6192490eec2a27b84d68d16f7b268a5ddbfd55 (patch) | |
tree | 954f4bcc651b5ab3698b0296dc1e003e8769424e /src | |
parent | 0ebf1cc83465a4058c172d74c823cce0bebe0e11 (diff) | |
download | postgresql-9f6192490eec2a27b84d68d16f7b268a5ddbfd55.tar.gz postgresql-9f6192490eec2a27b84d68d16f7b268a5ddbfd55.zip |
Add a CHECK_FOR_INTERRUPTS() in _bt_buildadd(). This fixes problem
with not responding to query cancel during the last stage of btree index
creation.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/access/nbtree/nbtsort.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c index b55c0c99047..0825c0ef257 100644 --- a/src/backend/access/nbtree/nbtsort.c +++ b/src/backend/access/nbtree/nbtsort.c @@ -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; |