Index: src/backend/tcop/postgres.c =================================================================== RCS file: /cvsroot/pgsql-server/src/backend/tcop/postgres.c,v retrieving revision 1.398 diff -c -c -r1.398 postgres.c *** src/backend/tcop/postgres.c 7 Apr 2004 05:05:49 -0000 1.398 --- src/backend/tcop/postgres.c 9 Apr 2004 17:42:46 -0000 *************** *** 2938,2944 **** /* * (3) read a command (loop blocks here) */ ! firstchar = ReadCommand(&input_message); /* * (4) disable async signal conditions again. --- 2938,2947 ---- /* * (3) read a command (loop blocks here) */ ! if (!in_fatal_exit) ! firstchar = ReadCommand(&input_message); ! else ! firstchar = EOF; /* * (4) disable async signal conditions again. *************** *** 3170,3176 **** * Otherwise it will fail to be called during other * backend-shutdown scenarios. */ ! proc_exit(0); case 'd': /* copy data */ case 'c': /* copy done */ --- 3173,3180 ---- * Otherwise it will fail to be called during other * backend-shutdown scenarios. */ ! proc_exit(!in_fatal_exit ? 0 : proc_exit_inprogress || ! !IsUnderPostmaster); case 'd': /* copy data */ case 'c': /* copy done */ Index: src/backend/utils/error/elog.c =================================================================== RCS file: /cvsroot/pgsql-server/src/backend/utils/error/elog.c,v retrieving revision 1.132 diff -c -c -r1.132 elog.c *** src/backend/utils/error/elog.c 5 Apr 2004 03:02:06 -0000 1.132 --- src/backend/utils/error/elog.c 9 Apr 2004 17:42:47 -0000 *************** *** 72,77 **** --- 72,79 ---- char *Log_line_prefix = NULL; /* format for extra log line info */ unsigned int Log_destination; + bool in_fatal_exit = false; + #ifdef HAVE_SYSLOG char *Syslog_facility; /* openlog() parameters */ char *Syslog_ident; *************** *** 442,448 **** */ fflush(stdout); fflush(stderr); ! proc_exit(proc_exit_inprogress || !IsUnderPostmaster); } /* --- 444,455 ---- */ fflush(stdout); fflush(stderr); ! ! if (in_fatal_exit) ! ereport(PANIC, (errmsg("fatal error during fatal exit, giving up"))); ! ! /* We will exit the backend by simulating a client EOF */ ! in_fatal_exit = true; } /* Index: src/include/tcop/tcopprot.h =================================================================== RCS file: /cvsroot/pgsql-server/src/include/tcop/tcopprot.h,v retrieving revision 1.64 diff -c -c -r1.64 tcopprot.h *** src/include/tcop/tcopprot.h 7 Apr 2004 05:05:50 -0000 1.64 --- src/include/tcop/tcopprot.h 9 Apr 2004 17:42:47 -0000 *************** *** 34,39 **** --- 34,40 ---- extern DLLIMPORT const char *debug_query_string; extern char *rendezvous_name; extern int max_stack_depth; + extern bool in_fatal_exit; /* GUC-configurable parameters */