Re: pg_restore [archiver] file offset in dump file is too - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: pg_restore [archiver] file offset in dump file is too
Date
Msg-id 436934F3.2000106@dunslane.net
Whole thread Raw
In response to Re: pg_restore [archiver] file offset in dump file is too  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: pg_restore [archiver] file offset in dump file is too
List pgsql-hackers

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_tstructres. 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


pgsql-hackers by date:

Previous
From: "Edward Di Geronimo Jr."
Date:
Subject: ODBC link to other databases
Next
From: Simon Riggs
Date:
Subject: Re: Reducing the overhead of NUMERIC data