Re: pgwin32_open returning EINVAL - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: pgwin32_open returning EINVAL
Date
Msg-id 20071220083238.GA21084@svr2.hagander.net
Whole thread Raw
In response to Re: pgwin32_open returning EINVAL  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pgwin32_open returning EINVAL  (Martijn van Oosterhout <kleptog@svana.org>)
Re: pgwin32_open returning EINVAL  ("Trevor Talbot" <quension@gmail.com>)
Re: pgwin32_open returning EINVAL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Dec 19, 2007 at 07:50:29PM -0500, Tom Lane wrote:
> Magnus Hagander <magnus@hagander.net> writes:
> > Updated version attached. Comments on the wording of the messages are also
> > welcome ;-)
> 
> Well, since you asked ;-) ... I don't particularly like this.

Well, it's better to have you say that before than to have to redo it
later, of course. Especially when we're this close to translation deadline,
and it contains new strings to translate :-P


> 1. Doesn't distinguish SHARING_VIOLATION from LOCK_VIOLATION.
> We might want to know that.

Yeah, I had that fixed locally already.


> 2. Do we really want this to be WARNING?  LOG seems a better idea,
> since it's not warning about anything the client app did wrong.

I put it as warning because I wanted to be sure the admin notices. If your
database is hanging 5+ seconds to open a file, you have a *big* problem,
and you need to fix it. Just putting it as LOG will probably make it much
more likely it's missed.

Is there a guideline somewhere that says what shuld be WARNING and what
should be LOG in general? If not, maybe there shuold be? ;-)


> 3. Doesn't follow the message style guide: shoehorning two sentences
> into errmsg() is surely not compliant.  Perhaps
> 
>     errmsg: could not open file \"%s\": sharing violation
>     OR errmsg: could not open file \"%s\": lock violation
> 
>     errdetail: Continuing to retry for up to 30 seconds.
> 
>     errhint: OK as you have it.

Yeah, Alvaro pointed parts of that out on IM already. Updated before
application, pending discussion about log level above.

ereport(WARNING,   (errmsg("could not open file \"%s\": %s violation", fileName,   (GetLastError() ==
ERROR_SHARING_VIOLATION)?_("sharing"):_("lock")), errdetail("Continuing to retry for 30 seconds."), errhint("You may
haveantivirus, backup or similar software
 
interfering with the database.")));


Is _("") the proper way to get a translatable string in like that, or is
there a better way?

//Magnus


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: Benchmark for GiST index?
Next
From: "Gokulakannan Somasundaram"
Date:
Subject: Re: Proposal for Null Bitmap Optimization(for TrailingNULLs)