3737 *
3838 *
3939 * IDENTIFICATION
40- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.340 2003/08/04 02:40:02 momjian Exp $
40+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.341 2003/08/12 18:23:20 tgl Exp $
4141 *
4242 * NOTES
4343 *
@@ -654,11 +654,16 @@ PostmasterMain(int argc, char *argv[])
654654 extern char * * environ ;
655655 char * * p ;
656656
657- elog (DEBUG3 , "%s: PostmasterMain: initial environ dump:" , progname );
658- elog (DEBUG3 , "-----------------------------------------" );
657+ ereport (DEBUG3 ,
658+ (errmsg_internal ("%s: PostmasterMain: initial environ dump:" ,
659+ progname )));
660+ ereport (DEBUG3 ,
661+ (errmsg_internal ("-----------------------------------------" )));
659662 for (p = environ ; * p ; ++ p )
660- elog (DEBUG3 , "\t%s" , * p );
661- elog (DEBUG3 , "-----------------------------------------" );
663+ ereport (DEBUG3 ,
664+ (errmsg_internal ("\t%s" , * p )));
665+ ereport (DEBUG3 ,
666+ (errmsg_internal ("-----------------------------------------" )));
662667 }
663668
664669 /*
@@ -1468,8 +1473,9 @@ processCancelRequest(Port *port, void *pkt)
14681473
14691474 if (backendPID == CheckPointPID )
14701475 {
1471- elog (DEBUG2 , "ignoring cancel request for checkpoint process %d" ,
1472- backendPID );
1476+ ereport (DEBUG2 ,
1477+ (errmsg_internal ("ignoring cancel request for checkpoint process %d" ,
1478+ backendPID )));
14731479 return ;
14741480 }
14751481 else if (ExecBackend )
@@ -1485,20 +1491,24 @@ processCancelRequest(Port *port, void *pkt)
14851491 if (bp -> cancel_key == cancelAuthCode )
14861492 {
14871493 /* Found a match; signal that backend to cancel current op */
1488- elog (DEBUG2 , "processing cancel request: sending SIGINT to process %d" ,
1489- backendPID );
1494+ ereport (DEBUG2 ,
1495+ (errmsg_internal ("processing cancel request: sending SIGINT to process %d" ,
1496+ backendPID )));
14901497 kill (bp -> pid , SIGINT );
14911498 }
14921499 else
14931500 /* Right PID, wrong key: no way, Jose */
1494- elog (DEBUG2 , "bad key in cancel request for process %d" ,
1495- backendPID );
1501+ ereport (DEBUG2 ,
1502+ (errmsg_internal ("bad key in cancel request for process %d" ,
1503+ backendPID )));
14961504 return ;
14971505 }
14981506 }
14991507
15001508 /* No matching backend */
1501- elog (DEBUG2 , "bad pid in cancel request for process %d" , backendPID );
1509+ ereport (DEBUG2 ,
1510+ (errmsg_internal ("bad pid in cancel request for process %d" ,
1511+ backendPID )));
15021512}
15031513
15041514/*
@@ -1669,7 +1679,9 @@ pmdie(SIGNAL_ARGS)
16691679
16701680 PG_SETMASK (& BlockSig );
16711681
1672- elog (DEBUG2 , "postmaster received signal %d" , postgres_signal_arg );
1682+ ereport (DEBUG2 ,
1683+ (errmsg_internal ("postmaster received signal %d" ,
1684+ postgres_signal_arg )));
16731685
16741686 switch (postgres_signal_arg )
16751687 {
@@ -1797,7 +1809,8 @@ reaper(SIGNAL_ARGS)
17971809
17981810 PG_SETMASK (& BlockSig );
17991811
1800- elog (DEBUG4 , "reaping dead processes" );
1812+ ereport (DEBUG4 ,
1813+ (errmsg_internal ("reaping dead processes" )));
18011814#ifdef HAVE_WAITPID
18021815 while ((pid = waitpid (-1 , & status , WNOHANG )) > 0 )
18031816 {
@@ -2007,8 +2020,10 @@ CleanupProc(int pid,
20072020 */
20082021 if (!FatalError )
20092022 {
2010- elog (DEBUG2 , "sending %s to process %d" ,
2011- (SendStop ? "SIGSTOP" : "SIGQUIT" ), (int ) bp -> pid );
2023+ ereport (DEBUG2 ,
2024+ (errmsg_internal ("sending %s to process %d" ,
2025+ (SendStop ? "SIGSTOP" : "SIGQUIT" ),
2026+ (int ) bp -> pid )));
20122027 kill (bp -> pid , (SendStop ? SIGSTOP : SIGQUIT ));
20132028 }
20142029 }
@@ -2093,8 +2108,10 @@ SignalChildren(int signal)
20932108
20942109 if (bp -> pid != MyProcPid )
20952110 {
2096- elog (DEBUG2 , "sending signal %d to process %d" ,
2097- signal , (int ) bp -> pid );
2111+ ereport (DEBUG2 ,
2112+ (errmsg_internal ("sending signal %d to process %d" ,
2113+ signal ,
2114+ (int ) bp -> pid )));
20982115 kill (bp -> pid , signal );
20992116 }
21002117
@@ -2207,8 +2224,9 @@ BackendStartup(Port *port)
22072224 }
22082225
22092226 /* in parent, normal */
2210- elog (DEBUG2 , "forked new backend, pid=%d socket=%d" ,
2211- (int ) pid , port -> sock );
2227+ ereport (DEBUG2 ,
2228+ (errmsg_internal ("forked new backend, pid=%d socket=%d" ,
2229+ (int ) pid , port -> sock )));
22122230
22132231 /*
22142232 * Everything's been successful, it's safe to add this backend to our
@@ -2525,10 +2543,14 @@ BackendFork(Port *port)
25252543 /*
25262544 * Debug: print arguments being passed to backend
25272545 */
2528- elog (DEBUG3 , "%s child[%d]: starting with (" , progname , MyProcPid );
2546+ ereport (DEBUG3 ,
2547+ (errmsg_internal ("%s child[%d]: starting with (" ,
2548+ progname , MyProcPid )));
25292549 for (i = 0 ; i < ac ; ++ i )
2530- elog (DEBUG3 , "\t%s" , av [i ]);
2531- elog (DEBUG3 , ")" );
2550+ ereport (DEBUG3 ,
2551+ (errmsg_internal ("\t%s" , av [i ])));
2552+ ereport (DEBUG3 ,
2553+ (errmsg_internal (")" )));
25322554
25332555 ClientAuthInProgress = false; /* client_min_messages is active
25342556 * now */
0 commit comments