Make pgstatindex respond to cancel interrupts.
authorRobert Haas <rhaas@postgresql.org>
Thu, 6 Oct 2011 16:08:59 +0000 (12:08 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 6 Oct 2011 16:11:30 +0000 (12:11 -0400)
A similar problem for pgstattuple() was fixed in April of 2010 by commit
33065ef8bc52253ae855bc959576e52d8a28ba06, but pgstatindex() seems to have
been overlooked.

Back-patch all the way, as with that commit, though not to 7.4 through
8.1, since those are now EOL.

contrib/pgstattuple/pgstatindex.c

index 509e31f1a850074dbf74cc4dffc5f6043e0aa56d..80a6793d23f065a2cf4cfabfa414c7667b6c20b3 100644 (file)
@@ -299,6 +299,8 @@ pgstatindex(PG_FUNCTION_ARGS)
        Buffer      buffer = ReadBuffer(rel, blkno);
        BTPageStat  stat;
 
+       CHECK_FOR_INTERRUPTS();
+
        /* scan one page */
        stat.blkno = blkno;
        GetBTPageStatistics(blkno, buffer, &stat);