Re: pg_dump -Ft failed on Windows XP - Mailing list pgsql-hackers

From Magnus Hagander
Subject Re: pg_dump -Ft failed on Windows XP
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCEA0F91E@algol.sollentuna.se
Whole thread Raw
In response to pg_dump -Ft failed on Windows XP  (Yoshiyuki Asaba <y-asaba@sraoss.co.jp>)
Responses Re: pg_dump -Ft failed on Windows XP
List pgsql-hackers
> > Ok. Should be easy enough once the code is fine - can you
> comment on
> > the patch as sent, if the code itself looks right provided
> i wrap it
> > up in a function in port/?
>
> Not sure if the error handling is adequate --- are there any
> cases besides EEXIST that should loop?

Well, per docs I can get:
EACCES (will certainly fail again since we're still working the same
directory)
EEXIST (covered)
EINVAL = invalid oflag or pmode, which should never happen
EMFILE = too many open files (that would be the one, but I doubd it'd
help that much)
ENOENT = path ont found (would happen agai non retry)


> A look at
> http://msdn.microsoft.com/library/default.asp?url=/library/en-
> us/vclib/html/_crt__tempnam.2c_._wtempnam.2c_.tmpnam.2c_._wtmpnam.asp
>
> suggests that tempnam() is also pretty fragile, esp. if
> you're passing NULLs.  Apparently it won't work at all if TMP
> isn't set?

I'm not *too* concerned about that, since TMP is normally set by the OS
itself. There's one set in the "system environment" (to c:\windows\temp
or whatrever) and then it's overridden by one set by the OS when it
loads a user profile.

Also to the point, what would you fall back to?

//Magnus


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Unresolved Win32 bug reports
Next
From: Tom Lane
Date:
Subject: Re: pg_dump -Ft failed on Windows XP