Index: src/backend/commands/tablecmds.c =================================================================== RCS file: /opt/cvsroot_postgresql/pgsql/src/backend/commands/tablecmds.c,v retrieving revision 1.330 diff -c -p -c -r1.330 tablecmds.c *** src/backend/commands/tablecmds.c 28 Apr 2010 16:10:41 -0000 1.330 --- src/backend/commands/tablecmds.c 21 Jun 2010 16:33:30 -0000 *************** copy_relation_data(SMgrRelation src, SMg *** 7049,7054 **** --- 7049,7057 ---- for (blkno = 0; blkno < nblocks; blkno++) { + /* If we got a cancel signal during the copy of the data, quit */ + CHECK_FOR_INTERRUPTS(); + smgrread(src, forkNum, blkno, buf); /* XLOG stuff */ Index: src/port/copydir.c =================================================================== RCS file: /opt/cvsroot_postgresql/pgsql/src/port/copydir.c,v retrieving revision 1.36 diff -c -p -c -r1.36 copydir.c *** src/port/copydir.c 1 Mar 2010 14:54:00 -0000 1.36 --- src/port/copydir.c 21 Jun 2010 16:33:30 -0000 *************** *** 23,28 **** --- 23,29 ---- #include #include "storage/fd.h" + #include "miscadmin.h" /* * On Windows, call non-macro versions of palloc; we can't reference *************** copydir(char *fromdir, char *todir, bool *** 67,72 **** --- 68,76 ---- while ((xlde = ReadDir(xldir, fromdir)) != NULL) { + /* If we got a cancel signal during the copy of the directory, quit */ + CHECK_FOR_INTERRUPTS(); + struct stat fst; if (strcmp(xlde->d_name, ".") == 0 || *************** copy_file(char *fromfile, char *tofile) *** 172,177 **** --- 176,184 ---- */ for (offset = 0;; offset += nbytes) { + /* If we got a cancel signal during the copy of the file, quit */ + CHECK_FOR_INTERRUPTS(); + nbytes = read(srcfd, buffer, COPY_BUF_SIZE); if (nbytes < 0) ereport(ERROR,