diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-01-14 05:08:17 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-01-14 05:08:17 +0000 |
commit | 36839c192706f5abd75bdcb02b6a7cace14ce108 (patch) | |
tree | 3022631b1208e1227684db86c12cbba7da15f611 /src/backend/commands/copy.c | |
parent | 027f144e390afa6f189270e8c2a2a56c0a88f646 (diff) | |
download | postgresql-36839c192706f5abd75bdcb02b6a7cace14ce108.tar.gz postgresql-36839c192706f5abd75bdcb02b6a7cace14ce108.zip |
Restructure backend SIGINT/SIGTERM handling so that 'die' interrupts
are treated more like 'cancel' interrupts: the signal handler sets a
flag that is examined at well-defined spots, rather than trying to cope
with an interrupt that might happen anywhere. See pghackers discussion
of 1/12/01.
Diffstat (limited to 'src/backend/commands/copy.c')
-rw-r--r-- | src/backend/commands/copy.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/backend/commands/copy.c b/src/backend/commands/copy.c index f33c6e9eb4c..25f6bace81e 100644 --- a/src/backend/commands/copy.c +++ b/src/backend/commands/copy.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.128 2001/01/06 03:33:17 ishii Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.129 2001/01/14 05:08:15 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -449,8 +449,7 @@ CopyTo(Relation rel, bool binary, bool oids, FILE *fp, { bool need_delim = false; - if (QueryCancel) - CancelQuery(); + CHECK_FOR_INTERRUPTS(); if (binary) { @@ -702,11 +701,7 @@ CopyFrom(Relation rel, bool binary, bool oids, FILE *fp, while (!done) { - if (QueryCancel) - { - lineno = 0; - CancelQuery(); - } + CHECK_FOR_INTERRUPTS(); lineno++; |