Skip site navigation (1) Skip section navigation (2)

Re: pgwin32_open returning EINVAL

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgwin32_open returning EINVAL
Date: 2007-11-29 21:15:04
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Tom Lane wrote:
> Magnus Hagander <magnus(at)hagander(dot)net> writes:
> > Tom Lane wrote:
> >> I'm still not convinced what you think the problematic situation is.
> > I believe Alvaros point is that several different GetLastError codes map
> > to the same errno code, making it impossible to see the difference
> > between those errors.
> (1) If we need to know the difference, then we shouldn't be mapping them
> to the same thing.

I totally agree with that, but the problem is the API is not very
flexible in this regard.  We can only use error codes that strerror() is
going to recognize.

A radical idea would be to store the Windows error code from
GetLastError in a new field in ErrorData, and display it in the next
ereport().  Perhaps use a special error callback to add an errcontext in
the possibly problematic cases.

> (2) Do we have any live cases where we must know this?  Much less enough
> cases to justify a global increase in the log chattiness?  It's not like
> we cannot get the information if we really need it.

Yes.  This thread shows the problem:

Basically he is getting this error:

2007-11-16 14:54:16 ERROR:  could not open relation 1663/16403/16487: Invalid argument

and no further indication of what's going on.  I did some searching a
couple of days ago and none of the cases I could find got a resolution.

Alvaro Herrera              
"Doing what he did amounts to sticking his fingers under the hood of the
implementation; if he gets his fingers burnt, it's his problem."  (Tom Lane)

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2007-11-29 21:25:45
Subject: Re: pgwin32_open returning EINVAL
Previous:From: Tom LaneDate: 2007-11-29 21:11:55
Subject: Re: [GENERAL] Empty arrays with ARRAY[]

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group