Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-19 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan <[EMAIL PROTECTED]> writes: Anyway, I think the attached patch will do what we need. I think you could leave Redirect_stderr out of the elog.c tests entirely, since redirection_done can never become set without it. Also, you introduced a bug: pgwin32_i

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-19 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Anyway, I think the attached patch will do what we need. I think you could leave Redirect_stderr out of the elog.c tests entirely, since redirection_done can never become set without it. Also, you introduced a bug: pgwin32_is_service is a function no?

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-19 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan <[EMAIL PROTECTED]> writes: Or, looking at it another way, why would we ever want the syslogger to use the chunking protocol at all? Ah, I misunderstood you. Yeah, I think you are right: if we are special-casing the syslogger process anyway, then it ne

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-17 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Or, looking at it another way, why would we ever want the syslogger to > use the chunking protocol at all? Ah, I misunderstood you. Yeah, I think you are right: if we are special-casing the syslogger process anyway, then it need only have these two be

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-17 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan <[EMAIL PROTECTED]> writes: Tom Lane wrote: Yeah, that would work. You'd have to get rid of the current ad-hoc method by which it is propagated to the syslogger child process (EXEC_BACKEND case), because now it will have to be propagated to all children

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-17 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Yeah, that would work. You'd have to get rid of the current ad-hoc >> method by which it is propagated to the syslogger child process >> (EXEC_BACKEND case), because now it will have to be propagated to all >> children; so postmaster.

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-17 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan <[EMAIL PROTECTED]> writes: Tom Lane wrote: I think offhand that the correct semantics of the flag are "we have redirected our original stderr into a pipe for syslogger", We could expose syslogger's redirection_done flag, which I think has th

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-16 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> I think offhand that the correct semantics of the flag are "we have >> redirected our original stderr into a pipe for syslogger", > We could expose syslogger's redirection_done flag, which I think has the > semantics you want. Yeah,

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-16 Thread Andrew Dunstan
Tom Lane wrote: I think offhand that the correct semantics of the flag are "we have redirected our original stderr into a pipe for syslogger", and in fact that we should transition the output format exactly at the instant where we do that; the starting of the child process happens at a slightl

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-16 Thread Zeugswetter Andreas ADI SD
> > 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? Should there be child backends when the logger did not start ? I'd think star

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-16 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> (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 || >

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-16 Thread Andrew Dunstan
Tom Lane wrote: Andrew Dunstan <[EMAIL PROTECTED]> 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 alrea

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-16 Thread Tom Lane
Andrew Dunstan <[EMAIL PROTECTED]> 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? regards, tom lane --

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-16 Thread Andrew Dunstan
Tom Lane wrote: I think we probably need a flag variable separate from the GUC variable to tell when to send using the chunk protocol. Is there any reason we can't just use a check on whether SysLoggerPID is not 0? It should only be set if the syslogger has in fact started. c

Re: [HACKERS] write_pipe_chunks patch messes up early error message output

2007-07-15 Thread Andrew Dunstan
Tom Lane wrote: I suspect that error messages coming out of the syslogger itself (and directed to the original stderr destination) will be similarly broken. I thought we had that case handled, but I could be wrong. So that patch still needs work. Yes, darnit. I think we probably need