37
37
*
38
38
*
39
39
* 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 $
41
41
*
42
42
* NOTES
43
43
*
@@ -654,11 +654,16 @@ PostmasterMain(int argc, char *argv[])
654
654
extern char * * environ ;
655
655
char * * p ;
656
656
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 ("-----------------------------------------" )));
659
662
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 ("-----------------------------------------" )));
662
667
}
663
668
664
669
/*
@@ -1468,8 +1473,9 @@ processCancelRequest(Port *port, void *pkt)
1468
1473
1469
1474
if (backendPID == CheckPointPID )
1470
1475
{
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 )));
1473
1479
return ;
1474
1480
}
1475
1481
else if (ExecBackend )
@@ -1485,20 +1491,24 @@ processCancelRequest(Port *port, void *pkt)
1485
1491
if (bp -> cancel_key == cancelAuthCode )
1486
1492
{
1487
1493
/* 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 )));
1490
1497
kill (bp -> pid , SIGINT );
1491
1498
}
1492
1499
else
1493
1500
/* 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 )));
1496
1504
return ;
1497
1505
}
1498
1506
}
1499
1507
1500
1508
/* 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 )));
1502
1512
}
1503
1513
1504
1514
/*
@@ -1669,7 +1679,9 @@ pmdie(SIGNAL_ARGS)
1669
1679
1670
1680
PG_SETMASK (& BlockSig );
1671
1681
1672
- elog (DEBUG2 , "postmaster received signal %d" , postgres_signal_arg );
1682
+ ereport (DEBUG2 ,
1683
+ (errmsg_internal ("postmaster received signal %d" ,
1684
+ postgres_signal_arg )));
1673
1685
1674
1686
switch (postgres_signal_arg )
1675
1687
{
@@ -1797,7 +1809,8 @@ reaper(SIGNAL_ARGS)
1797
1809
1798
1810
PG_SETMASK (& BlockSig );
1799
1811
1800
- elog (DEBUG4 , "reaping dead processes" );
1812
+ ereport (DEBUG4 ,
1813
+ (errmsg_internal ("reaping dead processes" )));
1801
1814
#ifdef HAVE_WAITPID
1802
1815
while ((pid = waitpid (-1 , & status , WNOHANG )) > 0 )
1803
1816
{
@@ -2007,8 +2020,10 @@ CleanupProc(int pid,
2007
2020
*/
2008
2021
if (!FatalError )
2009
2022
{
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 )));
2012
2027
kill (bp -> pid , (SendStop ? SIGSTOP : SIGQUIT ));
2013
2028
}
2014
2029
}
@@ -2093,8 +2108,10 @@ SignalChildren(int signal)
2093
2108
2094
2109
if (bp -> pid != MyProcPid )
2095
2110
{
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 )));
2098
2115
kill (bp -> pid , signal );
2099
2116
}
2100
2117
@@ -2207,8 +2224,9 @@ BackendStartup(Port *port)
2207
2224
}
2208
2225
2209
2226
/* 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 )));
2212
2230
2213
2231
/*
2214
2232
* Everything's been successful, it's safe to add this backend to our
@@ -2525,10 +2543,14 @@ BackendFork(Port *port)
2525
2543
/*
2526
2544
* Debug: print arguments being passed to backend
2527
2545
*/
2528
- elog (DEBUG3 , "%s child[%d]: starting with (" , progname , MyProcPid );
2546
+ ereport (DEBUG3 ,
2547
+ (errmsg_internal ("%s child[%d]: starting with (" ,
2548
+ progname , MyProcPid )));
2529
2549
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 (")" )));
2532
2554
2533
2555
ClientAuthInProgress = false; /* client_min_messages is active
2534
2556
* now */
0 commit comments