Re: Annoying error messages in _dosmaperr - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Annoying error messages in _dosmaperr
Date
Msg-id 22523.1224086614@sss.pgh.pa.us
Whole thread Raw
In response to Annoying error messages in _dosmaperr  (ITAGAKI Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Responses Re: Annoying error messages in _dosmaperr
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED
Next
From: "Joshua Tolley"
Date:
Subject: Re: Cross-column statistics revisited