ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes:
> Can we supress this annoying message? It seems to come from _dosmaperr,
> but the error "postmaster.pid is not found" is a *normal* situation
> in pg_resetxlog.
> -> open("%s/postmaster.pid", O_RDONLY, 0)
> -> pgwin32_open()
> -> _dosmaperr()
> #ifndef FRONTEND
> ereport(DEBUG5, ...);
> #else
> fprintf(stderr, _("mapped win32 error code %lu to %d"), e, errno);
> #endif
> DEBUG5 means the messages are completely non-critical. Therefore, client
> programs also don't need to report them, no? If possible, I'd like to
> remove the #else block (or all of them) from the above routine.
I suppose ideally we'd have some sort of debug-output switch on the
client side and code the #else branch like this
if (debug >= 5) fprintf(stderr, ...);
It's probably not worth the trouble to do that, but maybe we could just
have a FRONTEND_DEBUG compile time switch:
#ifndef FRONTEND ereport(DEBUG5, ...); #elif FRONTEND_DEBUG fprintf(stderr, _("mapped
win32error code %lu to %d"), e, errno); #endif
That would at least leave the code in place if anyone needed the
debugging output badly enough to do a custom build.
regards, tom lane