Re: Annoying error messages in _dosmaperr

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Annoying error messages in _dosmaperr
Date: 2008-10-15 16:03:34
Message-ID: 22523.1224086614@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ITAGAKI Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)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 win32 error 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua Tolley 2008-10-15 16:13:34 Re: Cross-column statistics revisited
Previous Message Andrew Dunstan 2008-10-15 16:03:33 Re: 8.3 .4 + Vista + MingW + initdb = ACCESS_DENIED