Re: pg_dump -Ft failed on Windows XP

From: "Zeugswetter Andreas DCP SD" <ZeugswetterA(at)spardat(dot)at>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Magnus Hagander" <mha(at)sollentuna(dot)net>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, <pgsql-hackers(at)postgresql(dot)org>, "Yoshiyuki Asaba" <y-asaba(at)sraoss(dot)co(dot)jp>
Subject: Re: pg_dump -Ft failed on Windows XP
Date: 2006-04-21 09:11:46
Message-ID: E1539E0ED7043848906A8FF995BDA579F318AB@m0143.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


> >> 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.
>
> OK, then maybe not having it would be equivalent to /tmp-not-writable
> on Unix, ie, admin error.
>
> > Also to the point, what would you fall back to?
>
> Current directory maybe?

It tries \ (tested on Win 2000), if the dir argument is NULL and TMP is
not set.
But TMP is usually set.

Attached is a working version not yet adapted to port/.
- memoryleak fixed
- use _tmpname and _fdopen not the compatibility tmpname and fdopen
(imho only cosmetic)
- EACCES fixed (Win2000 needs _S_IREAD | _S_IWRITE or fails with EACCES,
even as Admin)
- I suggest adding a prefix pg_temp_ (for leftover temp files after
crash,
the name I get is then usually pg_temp_2)

Andreas

Attachment Content-Type Size
pg_dump_tempfile.patch.txt text/plain 1.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gevik Babakhani 2006-04-21 09:48:43 TODO item question [pg_hba.conf]
Previous Message Andreas Pflug 2006-04-21 08:27:48 Re: Google SoC--Idea Request

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Brant 2006-04-21 15:02:50 Re: [Win32] Problem with rename()
Previous Message Magnus Hagander 2006-04-21 08:07:29 Re: Win32 semaphore patch