aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-07-28 22:05:47 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-07-28 22:05:47 +0000
commit98c120a2037391ad1d475b7e3566505ede36cb77 (patch)
tree890b0979875b3129a5c86edc70119a48a58dc23f
parentd79dc61df9af7ce97bbbeb1f7c8a7a89f9874e85 (diff)
downloadpostgresql-98c120a2037391ad1d475b7e3566505ede36cb77.tar.gz
postgresql-98c120a2037391ad1d475b7e3566505ede36cb77.zip
Revert ill-conceived patch that made elog(FATAL) the same as elog(ERROR)
followed by seeing EOF from client. If we want a safe session-kill capability we will need to write one, not break our error handling mechanism.
-rw-r--r--src/backend/tcop/postgres.c10
-rw-r--r--src/backend/utils/error/elog.c15
-rw-r--r--src/include/tcop/tcopprot.h3
3 files changed, 6 insertions, 22 deletions
diff --git a/src/backend/tcop/postgres.c b/src/backend/tcop/postgres.c
index a353122fc26..a8a7e0197ae 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.425 2004/07/27 05:11:03 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.426 2004/07/28 22:05:46 tgl Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@@ -2932,10 +2932,7 @@ PostgresMain(int argc, char *argv[], const char *username)
/*
* (3) read a command (loop blocks here)
*/
- if (!in_fatal_exit)
- firstchar = ReadCommand(&input_message);
- else
- firstchar = EOF;
+ firstchar = ReadCommand(&input_message);
/*
* (4) disable async signal conditions again.
@@ -3164,8 +3161,7 @@ PostgresMain(int argc, char *argv[], const char *username)
* Otherwise it will fail to be called during other
* backend-shutdown scenarios.
*/
- proc_exit(!in_fatal_exit ? 0 : proc_exit_inprogress ||
- !IsUnderPostmaster);
+ proc_exit(0);
case 'd': /* copy data */
case 'c': /* copy done */
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index c70958a9de1..d2f9117059c 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.142 2004/06/24 21:03:13 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/error/elog.c,v 1.143 2004/07/28 22:05:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -72,8 +72,6 @@ PGErrorVerbosity Log_error_verbosity = PGERROR_VERBOSE;
char *Log_line_prefix = NULL; /* format for extra log line info */
unsigned int Log_destination = LOG_DESTINATION_STDERR;
-bool in_fatal_exit = false;
-
#ifdef HAVE_SYSLOG
char *Syslog_facility; /* openlog() parameters */
char *Syslog_ident;
@@ -444,16 +442,7 @@ errfinish(int dummy,...)
*/
fflush(stdout);
fflush(stderr);
-
- if (in_fatal_exit)
- ereport(PANIC, (errmsg("fatal error during fatal exit, giving up")));
-
- /* not safe to longjump */
- if (!Warn_restart_ready || proc_exit_inprogress)
- proc_exit(proc_exit_inprogress || !IsUnderPostmaster);
-
- /* We will exit the backend by simulating a client EOF */
- in_fatal_exit = true;
+ proc_exit(proc_exit_inprogress || !IsUnderPostmaster);
}
/*
diff --git a/src/include/tcop/tcopprot.h b/src/include/tcop/tcopprot.h
index 0f55e9787fd..7af3747c8bf 100644
--- a/src/include/tcop/tcopprot.h
+++ b/src/include/tcop/tcopprot.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.67 2004/06/11 01:09:22 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/tcop/tcopprot.h,v 1.68 2004/07/28 22:05:47 tgl Exp $
*
* OLD COMMENTS
* This file was created so that other c files could get the two
@@ -33,7 +33,6 @@ extern bool InError;
extern CommandDest whereToSendOutput;
extern DLLIMPORT const char *debug_query_string;
extern int max_stack_depth;
-extern bool in_fatal_exit;
/* GUC-configurable parameters */