Skip to content

Commit 12a9322

Browse files
committed
Cancel query support from Massimo
1 parent 23e1080 commit 12a9322

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/commands/copy.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
*
88
* IDENTIFICATION
9-
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.88 1999/09/18 19:06:40 tgl Exp $
9+
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.89 1999/09/27 20:00:44 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -29,6 +29,7 @@
2929
#include "lib/stringinfo.h"
3030
#include "libpq/libpq.h"
3131
#include "miscadmin.h"
32+
#include "tcop/tcopprot.h"
3233
#include "utils/acl.h"
3334
#include "utils/builtins.h"
3435
#include "utils/syscache.h"
@@ -414,6 +415,8 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
414415

415416
while (HeapTupleIsValid(tuple = heap_getnext(scandesc, 0)))
416417
{
418+
if (QueryCancel)
419+
CancelQuery();
417420

418421
if (oids && !binary)
419422
{
@@ -686,6 +689,9 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, char *delim)
686689

687690
while (!done)
688691
{
692+
if (QueryCancel)
693+
CancelQuery();
694+
689695
if (!binary)
690696
{
691697
int newline = 0;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy