aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tcop/postgres.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2007-06-29 17:07:39 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2007-06-29 17:07:39 +0000
commit10af02b912714a1cb423d100186b43b20142f008 (patch)
tree4de848c50a809936d05d93a4d6755dd614f19498 /src/backend/tcop/postgres.c
parentc786796d0a7931d67a38840d899c4e45ef4c7bf6 (diff)
downloadpostgresql-10af02b912714a1cb423d100186b43b20142f008.tar.gz
postgresql-10af02b912714a1cb423d100186b43b20142f008.zip
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.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index 94fd65e5d44..c5ede140042 100644
--- a/src/backend/tcop/postgres.c
+++ b/src/backend/tcop/postgres.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.534 2007/06/23 22:12:52 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.535 2007/06/29 17:07:39 alvherre Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -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)
{