summaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorAlvaro Herrera2007-06-29 17:07:39 +0000
committerAlvaro Herrera2007-06-29 17:07:39 +0000
commit7f6535fde2559653f636127da9e1f6c48ecc30bb (patch)
treec67229feeb24a7dc9bdeb81f78795f90686aadcb /src/backend/tcop/postgres.c
parent07ecea0ab874b01ed65a14c98ffb7914138bd7c9 (diff)
Arrange for SIGINT in autovacuum workers to cancel the current table and
continue with the schedule. Change current uses of SIGINT to abort a worker into SIGTERM, which keeps the old behaviour of terminating the process. Patch from ITAGAKI Takahiro, with some editorializing of my own.
Diffstat (limited to 'src/backend/tcop/postgres.c')
-rw-r--r--src/backend/tcop/postgres.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index d98c7bea04..9ee4a7e960 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -51,6 +51,7 @@
#include "optimizer/planner.h"
#include "parser/analyze.h"
#include "parser/parser.h"
+#include "postmaster/autovacuum.h"
#include "rewrite/rewriteHandler.h"
#include "storage/freespace.h"
#include "storage/ipc.h"
@@ -2540,9 +2541,14 @@ ProcessInterrupts(void)
ImmediateInterruptOK = false; /* not idle anymore */
DisableNotifyInterrupt();
DisableCatchupInterrupt();
- ereport(FATAL,
- (errcode(ERRCODE_ADMIN_SHUTDOWN),
- errmsg("terminating connection due to administrator command")));
+ if (IsAutoVacuumWorkerProcess())
+ ereport(FATAL,
+ (errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("terminating autovacuum process due to administrator command")));
+ else
+ ereport(FATAL,
+ (errcode(ERRCODE_ADMIN_SHUTDOWN),
+ errmsg("terminating connection due to administrator command")));
}
if (QueryCancelPending)
{