Re: write_pipe_chunks patch messes up early error message output - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: write_pipe_chunks patch messes up early error message output
Date
Msg-id 469B740E.2020507@dunslane.net
Whole thread Raw
In response to Re: write_pipe_chunks patch messes up early error message output  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: write_pipe_chunks patch messes up early error message output  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers

Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>   
>> Is there any reason we can't just use a check on whether SysLoggerPID is 
>> not 0?
>>     
>
> (a) that really shouldn't be exported out of postmaster.c, and (b) it is
> not readily available to child backends is it?
>
>     
>   

It's already used in elog.c in Win32 code:
       if ((!Redirect_stderr || am_syslogger ||            (!IsUnderPostmaster && SysLoggerPID==0)) && 
pgwin32_is_service())           write_eventlog(edata->elevel, buf.data);

Child backends might have an out of date version if we restart the 
Syslogger, but would that matter in this case? For current purposes all 
we need is to know that the syslogger has in fact started, ISTM.

If that makes you puke we can do something more elegant, but I suspect 
it will amount to the same thing.

cheers

andrew




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: write_pipe_chunks patch messes up early error message output
Next
From: Tom Lane
Date:
Subject: Re: write_pipe_chunks patch messes up early error message output