Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-21 Thread Magnus Hagander
On Fri, Dec 21, 2007 at 01:30:07AM -0500, Jaime Casanova wrote: On Dec 20, 2007 9:31 PM, Alvaro Herrera [EMAIL PROTECTED] wrote: Jaime Casanova escribió: it doesn't compile on current head on mingw 5.1 and msys 1.0.10; of course, it doesn't compile on 8.2 neither in order to Alvaro's

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-21 Thread Alvaro Herrera
Andrew Dunstan escribió: Alvaro Herrera wrote: I think this patch should fix it. I think win32.mak needs to be similarly patched. Don't you also need to add pgsleep.o to $(OBJS) in the win32 stanza? Hmm. Wow, that's silly. I introduced a hack in a Replicator's Makefile to avoid having

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Magnus Hagander
On Wed, Dec 19, 2007 at 07:50:29PM -0500, Tom Lane wrote: Magnus Hagander [EMAIL PROTECTED] 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

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Martijn van Oosterhout
On Thu, Dec 20, 2007 at 09:32:38AM +0100, Magnus Hagander wrote: (errmsg(could not open file \%s\: %s violation, fileName, (GetLastError() == ERROR_SHARING_VIOLATION)?_(sharing):_(lock)), Is _() the proper way to get a translatable string in like that, or is there a better way?

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Trevor Talbot
On 12/20/07, Magnus Hagander [EMAIL PROTECTED] wrote: 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

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Magnus Hagander
On Thu, Dec 20, 2007 at 04:39:55AM -0800, Trevor Talbot wrote: On 12/20/07, Magnus Hagander [EMAIL PROTECTED] wrote: ereport(WARNING, (errmsg(could not open file \%s\: %s violation, fileName, (GetLastError() == ERROR_SHARING_VIOLATION)?_(sharing):_(lock)),

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Trevor Talbot
On 12/20/07, Magnus Hagander [EMAIL PROTECTED] wrote: On Thu, Dec 20, 2007 at 04:39:55AM -0800, Trevor Talbot wrote: On 12/20/07, Magnus Hagander [EMAIL PROTECTED] wrote: ereport(WARNING, (errmsg(could not open file \%s\: %s violation, fileName, (GetLastError() ==

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Alvaro Herrera
Trevor Talbot escribió: Without looking myself, is it possible for errhint() or errdetail() to do something that affects GetLastError()? It's like errno, checking it very far away from the call site makes me nervous. Yeah, they call gettext(), palloc/pfree/pstrdup and various StringInfo

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Magnus Hagander
On Thu, Dec 20, 2007 at 04:47:33AM -0800, Trevor Talbot wrote: On 12/20/07, Magnus Hagander [EMAIL PROTECTED] wrote: On Thu, Dec 20, 2007 at 04:39:55AM -0800, Trevor Talbot wrote: On 12/20/07, Magnus Hagander [EMAIL PROTECTED] wrote: ereport(WARNING, (errmsg(could not open file

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Magnus Hagander
On Thu, Dec 20, 2007 at 10:26:46AM -0500, Tom Lane wrote: Magnus Hagander [EMAIL PROTECTED] writes: On Wed, Dec 19, 2007 at 07:50:29PM -0500, Tom Lane wrote: 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.

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes: On Wed, Dec 19, 2007 at 07:50:29PM -0500, Tom Lane wrote: 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

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Magnus Hagander
On Thu, Dec 20, 2007 at 10:11:10AM -0500, Tom Lane wrote: Trevor Talbot [EMAIL PROTECTED] writes: Without looking myself, is it possible for errhint() or errdetail() to do something that affects GetLastError()? Hmm ... the macro framework is designed so that the arguments get evaluated

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes: On Thu, Dec 20, 2007 at 10:11:10AM -0500, Tom Lane wrote: BTW, I concur with Martijn's comment to avoid constructing phrases from spare parts; it creates a translation problem, and in this case you'd only be saving a few bytes anyway. Ok. Are you

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Trevor Talbot
On 12/20/07, Magnus Hagander [EMAIL PROTECTED] wrote: On Thu, Dec 20, 2007 at 04:39:55AM -0800, Trevor Talbot wrote: On 12/20/07, Magnus Hagander [EMAIL PROTECTED] wrote: ereport(WARNING, (errmsg(could not open file \%s\: %s violation, fileName, (GetLastError() ==

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Tom Lane
Trevor Talbot [EMAIL PROTECTED] writes: Without looking myself, is it possible for errhint() or errdetail() to do something that affects GetLastError()? Hmm ... the macro framework is designed so that the arguments get evaluated before anything very interesting happens, but it might be better

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Magnus Hagander
On Thu, Dec 20, 2007 at 07:57:23AM -0800, Trevor Talbot wrote: I'd expect the compiler to optimize away those, but I'll make it a var anyawy. It can't; it's an opaque callout to kernel32.dll, and there's nothing that tells the optimizer when you can expect to get the same result. That

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Magnus Hagander
Magnus Hagander wrote: On Thu, Dec 20, 2007 at 10:26:46AM -0500, Tom Lane wrote: Magnus Hagander [EMAIL PROTECTED] writes: On Wed, Dec 19, 2007 at 07:50:29PM -0500, Tom Lane wrote: 2. Do we really want this to be WARNING? LOG seems a better idea, since it's not warning about anything the

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Jaime Casanova
On Dec 20, 2007 3:29 PM, Magnus Hagander [EMAIL PROTECTED] wrote: Magnus Hagander wrote: On Thu, Dec 20, 2007 at 10:26:46AM -0500, Tom Lane wrote: Magnus Hagander [EMAIL PROTECTED] writes: On Wed, Dec 19, 2007 at 07:50:29PM -0500, Tom Lane wrote: 2. Do we really want this to be WARNING?

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Alvaro Herrera
Jaime Casanova escribió: it doesn't compile on current head on mingw 5.1 and msys 1.0.10; of course, it doesn't compile on 8.2 neither in order to Alvaro's contact to test it Yeah, the buildfarm is failing in the same way.

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Alvaro Herrera
Jaime Casanova escribió: it doesn't compile on current head on mingw 5.1 and msys 1.0.10; of course, it doesn't compile on 8.2 neither in order to Alvaro's contact to test it I think this patch should fix it. I think win32.mak needs to be similarly patched. -- Alvaro Herrera

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Andrew Dunstan
Alvaro Herrera wrote: Jaime Casanova escribió: it doesn't compile on current head on mingw 5.1 and msys 1.0.10; of course, it doesn't compile on 8.2 neither in order to Alvaro's contact to test it I think this patch should fix it. I think win32.mak needs to be similarly patched.

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-20 Thread Jaime Casanova
On Dec 20, 2007 9:31 PM, Alvaro Herrera [EMAIL PROTECTED] wrote: Jaime Casanova escribió: it doesn't compile on current head on mingw 5.1 and msys 1.0.10; of course, it doesn't compile on 8.2 neither in order to Alvaro's contact to test it I think this patch should fix it. I think

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-19 Thread Magnus Hagander
On Sun, Dec 16, 2007 at 10:31:59AM +, Gregory Stark wrote: Tom Lane [EMAIL PROTECTED] writes: Gregory Stark [EMAIL PROTECTED] writes: Andrew Dunstan [EMAIL PROTECTED] writes: Interesting. Maybe forever is going a bit too far, but retrying for n seconds or so. I think looping

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-19 Thread Magnus Hagander
On Sat, Dec 15, 2007 at 10:31:38PM -0500, Tom Lane wrote: Gregory Stark [EMAIL PROTECTED] writes: Andrew Dunstan [EMAIL PROTECTED] writes: Interesting. Maybe forever is going a bit too far, but retrying for n seconds or so. I think looping forever is the right thing. Having a fixed

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-19 Thread Gregory Stark
Magnus Hagander [EMAIL PROTECTED] writes: If your software is locking a file for that long, that software is more than just broken, it's horribly broken. Having a workaround against something that might happen once or twice because of a bug in the other software is one thing, but if it's

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-19 Thread Magnus Hagander
On Wed, Dec 19, 2007 at 01:05:00PM +, Gregory Stark wrote: Magnus Hagander [EMAIL PROTECTED] writes: If your software is locking a file for that long, that software is more than just broken, it's horribly broken. Having a workaround against something that might happen once or twice

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-19 Thread Magnus Hagander
On Wed, Dec 19, 2007 at 11:23:35AM -0300, Alvaro Herrera wrote: Magnus Hagander wrote: On Sat, Dec 15, 2007 at 10:31:38PM -0500, Tom Lane wrote: Gregory Stark [EMAIL PROTECTED] writes: Andrew Dunstan [EMAIL PROTECTED] writes: Interesting. Maybe forever is going a bit too far, but

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-19 Thread Alvaro Herrera
Magnus Hagander wrote: On Sat, Dec 15, 2007 at 10:31:38PM -0500, Tom Lane wrote: Gregory Stark [EMAIL PROTECTED] writes: Andrew Dunstan [EMAIL PROTECTED] writes: Interesting. Maybe forever is going a bit too far, but retrying for n seconds or so. I think looping forever is the

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-19 Thread Zeugswetter Andreas ADI SD
Yeah, I think it would be useful to log one message if after (say) 5 seconds we still haven't been able to open the file. Either that, or on the first run. Imho 1-5s is better, so that would be after the 10-50th try. loop. It's supposed to loop 300 times. Yes. (Are we OK with the

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-19 Thread Andrew Dunstan
Zeugswetter Andreas ADI SD wrote: Yes 0.1 s is imho good. Btw. m$ is talking about milliseconds (http://support.microsoft.com/kb/316609) We have seen cases in the past where these locks last quite a long time. That 30s total timeout in rename and unlink was not chosen arbitrarily -

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-19 Thread Magnus Hagander
On Wed, Dec 19, 2007 at 04:20:23PM +0100, Zeugswetter Andreas ADI SD wrote: Yeah, I think it would be useful to log one message if after (say) 5 seconds we still haven't been able to open the file. Either that, or on the first run. Imho 1-5s is better, so that would be after the

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-19 Thread Magnus Hagander
On Wed, Dec 19, 2007 at 04:44:12PM +0100, Magnus Hagander wrote: On Wed, Dec 19, 2007 at 04:20:23PM +0100, Zeugswetter Andreas ADI SD wrote: Yeah, I think it would be useful to log one message if after (say) 5 seconds we still haven't been able to open the file. Either that, or

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-19 Thread Alvaro Herrera
Zeugswetter Andreas ADI SD wrote: I think not. 0.1 seconds is better. We don't want to delay a full second if it's just a transient thing. Yes 0.1 s is imho good. Btw. m$ is talking about milliseconds (http://support.microsoft.com/kb/316609) Hm, the article only mentions

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-19 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes: Updated version attached. Comments on the wording of the messages are also welcome ;-) Well, since you asked ;-) ... I don't particularly like this. 1. Doesn't distinguish SHARING_VIOLATION from LOCK_VIOLATION. We might want to know that. 2. Do we

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-16 Thread Gregory Stark
Tom Lane [EMAIL PROTECTED] writes: Gregory Stark [EMAIL PROTECTED] writes: Andrew Dunstan [EMAIL PROTECTED] writes: Interesting. Maybe forever is going a bit too far, but retrying for n seconds or so. I think looping forever is the right thing. Having a fixed timeout just means Postgres

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-15 Thread Magnus Hagander
Alvaro Herrera wrote: Magnus Hagander wrote: On Thu, Dec 13, 2007 at 09:55:33AM -0300, Alvaro Herrera wrote: Many of these are nonsensical -- we know this is not a device, nor network access. Still there is more than one possibility, and I don't know which ones should be really acceptable in

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-15 Thread Andrew Dunstan
Magnus Hagander wrote: Alvaro Herrera wrote: Magnus Hagander wrote: On Thu, Dec 13, 2007 at 09:55:33AM -0300, Alvaro Herrera wrote: Many of these are nonsensical -- we know this is not a device, nor network access. Still there is more than one possibility, and I don't know

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-15 Thread Gregory Stark
Andrew Dunstan [EMAIL PROTECTED] writes: Magnus Hagander wrote: Alvaro Herrera wrote: Magnus Hagander wrote: Note that their behavior on finding SHARING_VIOLATION or LOCK_VIOLATION is to retry forever until the error goes away, on the theory that the antivirus/backup software will

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-15 Thread Tom Lane
Gregory Stark [EMAIL PROTECTED] writes: Andrew Dunstan [EMAIL PROTECTED] writes: Interesting. Maybe forever is going a bit too far, but retrying for n seconds or so. I think looping forever is the right thing. Having a fixed timeout just means Postgres will break sometimes instead of all the

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-14 Thread Magnus Hagander
On Thu, Dec 13, 2007 at 09:55:33AM -0300, Alvaro Herrera wrote: Alvaro Herrera wrote: So _anything_ could be EINVAL. Including the several cases that _dosmaperr treat as EACCES. So I'm afraid that for this experiment to be successful, we would have to remove not only the EINVAL cases

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-14 Thread Alvaro Herrera
Magnus Hagander wrote: On Thu, Dec 13, 2007 at 09:55:33AM -0300, Alvaro Herrera wrote: Many of these are nonsensical -- we know this is not a device, nor network access. Still there is more than one possibility, and I don't know which ones should be really acceptable in this context or

Re: [HACKERS] pgwin32_open returning EINVAL

2007-12-13 Thread Alvaro Herrera
Alvaro Herrera wrote: So _anything_ could be EINVAL. Including the several cases that _dosmaperr treat as EACCES. So I'm afraid that for this experiment to be successful, we would have to remove not only the EINVAL cases from doserrors[], but also any other code that appears more than once

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-30 Thread Magnus Hagander
On Thu, Nov 29, 2007 at 05:48:23PM -0500, Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: Well, since EINVAL is the default result from _dosmaperr, and none of the cases it represents are expected, why don't we just remove all of the explicit mappings to EINVAL

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Magnus Hagander
On Wed, Nov 28, 2007 at 05:20:46PM +0100, Magnus Hagander wrote: On Wed, Nov 28, 2007 at 12:24:26PM -0300, Alvaro Herrera wrote: Martijn van Oosterhout wrote: On Wed, Nov 28, 2007 at 11:57:35AM -0300, Alvaro Herrera wrote: Can we do something like this to report the Win32 error code so

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Magnus Hagander
On Thu, Nov 29, 2007 at 09:09:47AM -0300, Alvaro Herrera wrote: Magnus Hagander wrote: On Wed, Nov 28, 2007 at 05:20:46PM +0100, Magnus Hagander wrote: On Wed, Nov 28, 2007 at 12:24:26PM -0300, Alvaro Herrera wrote: Martijn van Oosterhout wrote: On Wed, Nov 28, 2007 at 11:57:35AM

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Alvaro Herrera
Magnus Hagander wrote: On Wed, Nov 28, 2007 at 05:20:46PM +0100, Magnus Hagander wrote: On Wed, Nov 28, 2007 at 12:24:26PM -0300, Alvaro Herrera wrote: Martijn van Oosterhout wrote: On Wed, Nov 28, 2007 at 11:57:35AM -0300, Alvaro Herrera wrote: Can we do something like this to

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Magnus Hagander
On Thu, Nov 29, 2007 at 09:43:30AM -0300, Alvaro Herrera wrote: Magnus Hagander wrote: On Thu, Nov 29, 2007 at 09:09:47AM -0300, Alvaro Herrera wrote: Magnus Hagander wrote: On Wed, Nov 28, 2007 at 05:20:46PM +0100, Magnus Hagander wrote: On Wed, Nov 28, 2007 at 12:24:26PM -0300,

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Alvaro Herrera
Magnus Hagander wrote: On Thu, Nov 29, 2007 at 09:09:47AM -0300, Alvaro Herrera wrote: Magnus Hagander wrote: On Wed, Nov 28, 2007 at 05:20:46PM +0100, Magnus Hagander wrote: On Wed, Nov 28, 2007 at 12:24:26PM -0300, Alvaro Herrera wrote: Martijn van Oosterhout wrote: On Wed,

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Alvaro Herrera
Magnus Hagander wrote: On Thu, Nov 29, 2007 at 09:43:30AM -0300, Alvaro Herrera wrote: Magnus Hagander wrote: Maybe. I'm concerned we might end up logging a whole lot more, for cases where it's not an actual error. For example, a file that doesn't exist doesn't necessarily mean it's

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Magnus Hagander wrote: Maybe. I'm concerned we might end up logging a whole lot more, for cases where it's not an actual error. I'm very concerned about that too, and think that DEBUG5 is just fine. Hmm, I just noticed a bug in those fprintf calls --

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: Magnus Hagander wrote: Maybe. I'm concerned we might end up logging a whole lot more, for cases where it's not an actual error. I'm very concerned about that too, and think that DEBUG5 is just fine. Well, the analysis was already

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: I'm very concerned about that too, and think that DEBUG5 is just fine. Well, the analysis was already done which says this shouldn't be a problem. That analysis is full of holes --- FileRead and FileWrite for starters.

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: I'm very concerned about that too, and think that DEBUG5 is just fine. Well, the analysis was already done which says this shouldn't be a problem. That analysis is full of holes --- FileRead and FileWrite for

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: That analysis is full of holes --- FileRead and FileWrite for starters. I already did. The case where they retry do not call _dosmaperr. What's retry got to do with it? What's displeasing me is the idea of LOG messages showing up

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: That analysis is full of holes --- FileRead and FileWrite for starters. I already did. The case where they retry do not call _dosmaperr. What's retry got to do with it? What's displeasing me is the idea of LOG

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: I think a reasonable compromise is to turn the ereport() in _dosmaperr to DEBUG1 instead. That way it won't clutter any log by default, and in the cases where we're actually interested in tracking the problematic situation, we don't need to get huge

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] 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.

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Magnus Hagander
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: I think a reasonable compromise is to turn the ereport() in _dosmaperr to DEBUG1 instead. That way it won't clutter any log by default, and in the cases where we're actually interested in tracking the problematic situation, we don't

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Alvaro Herrera
Tom Lane wrote: Magnus Hagander [EMAIL PROTECTED] 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

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: (2) Do we have any live cases where we must know this? Yes. This thread shows the problem: http://archives.postgresql.org/pgsql-es-ayuda/2007-11/msg00354.php Basically he is getting this error: 2007-11-16 14:54:16 ERROR: could not

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Alvaro Herrera
Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: (2) Do we have any live cases where we must know this? Yes. This thread shows the problem: http://archives.postgresql.org/pgsql-es-ayuda/2007-11/msg00354.php Basically he is getting this error: 2007-11-16

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Magnus Hagander
Alvaro Herrera wrote: Tom Lane wrote: Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: (2) Do we have any live cases where we must know this? Yes. This thread shows the problem: http://archives.postgresql.org/pgsql-es-ayuda/2007-11/msg00354.php Basically he is getting this error:

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-29 Thread Tom Lane
Alvaro Herrera [EMAIL PROTECTED] writes: Tom Lane wrote: Well, since EINVAL is the default result from _dosmaperr, and none of the cases it represents are expected, why don't we just remove all of the explicit mappings to EINVAL from doserrors[]? Well, the problematic routine is not already

[HACKERS] pgwin32_open returning EINVAL

2007-11-28 Thread Alvaro Herrera
Hi, We've seen several cases of people (running 8.1 or 8.2) that see messages like this: 2007-11-26 11:41:59 ERROR: could not open relation 1663/352369/353685: Invalid argument The platform is Win32. The problem is that pgwin32_open reduces any error code from GetLastError that's not

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-28 Thread Martijn van Oosterhout
On Wed, Nov 28, 2007 at 11:57:35AM -0300, Alvaro Herrera wrote: Can we do something like this to report the Win32 error code so that the user has a higher chance of figuring out what's going on? The Windows API provides a way to get the error message associated with the code. It seems it would

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-28 Thread Alvaro Herrera
Martijn van Oosterhout wrote: On Wed, Nov 28, 2007 at 11:57:35AM -0300, Alvaro Herrera wrote: Can we do something like this to report the Win32 error code so that the user has a higher chance of figuring out what's going on? The Windows API provides a way to get the error message

Re: [HACKERS] pgwin32_open returning EINVAL

2007-11-28 Thread Magnus Hagander
On Wed, Nov 28, 2007 at 12:24:26PM -0300, Alvaro Herrera wrote: Martijn van Oosterhout wrote: On Wed, Nov 28, 2007 at 11:57:35AM -0300, Alvaro Herrera wrote: Can we do something like this to report the Win32 error code so that the user has a higher chance of figuring out what's going on?