Re: pg_restore [archiver] file offset in dump file is too

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Magnus Hagander <mha(at)sollentuna(dot)net>, tgl(at)sss(dot)pgh(dot)pa(dot)us, Kevin(dot)Grittner(at)wicourts(dot)gov, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_restore [archiver] file offset in dump file is too
Date: 2005-12-04 04:33:31
Message-ID: 200512040433.jB44XVh13270@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Added to TODO:

o Add long file support for binary pg_dump output

While Win32 supports 64-bit files, the MinGW API does not,
meaning we have to build an fseeko replacement on top of the
Win32 API, and we have to make sure MinGW handles it.

---------------------------------------------------------------------------

Andrew Dunstan wrote:
>
>
> Bruce Momjian wrote:
>
> >Andrew Dunstan wrote:
> >
> >
> >>There is no fseeko in the Windows libraries, nor any provision in the
> >>mingw headers that I can see for a 64 bit off_t. So we would need to
> >>roll our own to some extent - I think we need more than just a bit of
> >>configure cleverness.
> >>
> >>However, there is a Windows library routine to do a 64bit seek and
> >>return the file position, so we could fairly easily implement fseeko and
> >>ftello based on that. See
> >>http://msdn.microsoft.com/library/en-us/vclib/html/_crt__lseek.2c_._lseeki64.asp
> >>
> >>
> >
> >See src/port/fseeko.c for a version built on fsetpos().
> >
> >
> >
>
> Yeah, I'm not made warm and fuzzy by the comments about fpos_t in
> mingw's stdio.h, though:
>
> /*
> * An opaque data type used for storing file positions... The contents of
> * this type are unknown, but we (the compiler) need to know the size
> * because the programmer using fgetpos and fsetpos will be setting aside
> * storage for fpos_t structres. Actually I tested using a byte array and
> * it is fairly evident that the fpos_t type is a long (in CRTDLL.DLL).
> * Perhaps an unsigned long? TODO? It's definitely a 64-bit number in
> * MSVCRT however, and for now `long long' will do.
> */
>
>
> But the example program on MSDN contains "pos = 14", which leads one to
> assume that it really is some simple int underneath.
>
> cheers
>
> andrew
>
> cheers
>
> andrew
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-12-04 04:38:00 Re: pg_restore [archiver] file offset in dump file is too
Previous Message Bruce Momjian 2005-12-04 04:14:51 Re: I can't get row type from tuple (SPI)