Thread: Re: [BUGS] BUG #1466: #maintenace_work_mem = 16384
>> Can defaults be set to the result of a function? > >By "power-on default" I mean the value that the variable is assigned as >its static initializer. That has to be a link-time constant (at least >in C ...). Anything else will mean misbehavior if an error occurs >before the GUC code itself has been able to initialize. Hmm. Ok. >> The problem with changing the default from stderr to >eventlog is that it >> will send the messages to the eventlog even if running from >the console, >> which is not good. > >It's not perfect maybe, but it's certainly less bad than the present >behavior. At least we know that the eventlog will always exist on >Windows. I'm not sure how interesting the running-from-the-console >case actually is for Windows users anyway. It's definitly interesting when debugging :-) What do you think of the following as a fix? It should put the message in the eventlog when running as a service, but stderr when on the console. //Magnus
Attachment
"Magnus Hagander" <mha@sollentuna.net> writes: > What do you think of the following as a fix? I dislike going through write_stderr because it requires an extra, useless gettext() call, and because in the Windows case it imposes an arbitrary length limit that is certain to be exceeded. The length limit is probably OK for the existing limited usages of write_stderr, but you can't assume that every log message the system ever prints is going to be under 2K. The proposed test on Redirect_stderr looks pretty fishy too; for one thing it will almost certainly not be the right thing inside the stderr logger subprocess itself. regards, tom lane