diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-10 20:18:25 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2006-03-10 20:18:25 +0000 |
commit | d777a571336aff734a4f00cbcb7b9bd268dd23d7 (patch) | |
tree | 5dcdfdeebd5b8c24d8b6885e148ec75e147e1fbf | |
parent | effecebad1cdbc5fbdf7d4fa972df614ca974bcd (diff) | |
download | postgresql-d777a571336aff734a4f00cbcb7b9bd268dd23d7.tar.gz postgresql-d777a571336aff734a4f00cbcb7b9bd268dd23d7.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.
-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 d18ecbce578..b674eacd587 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.95.2.2 2006/01/07 22:45:53 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.95.2.3 2006/03/10 20:18:25 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -475,6 +475,12 @@ _bt_buildadd(BTWriteState *wstate, BTPageState *state, BTItem bti) Size pgspc; Size btisz; + /* + * 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; |