Re: pg_dump and large files - is this a problem? - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: pg_dump and large files - is this a problem?
Date
Msg-id 200210230246.g9N2kHn07863@candle.pha.pa.us
Whole thread Raw
In response to Re: pg_dump and large files - is this a problem?  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: pg_dump and large files - is this a problem?  (Philip Warner <pjw@rhyme.com.au>)
List pgsql-hackers
Philip Warner wrote:
> At 05:37 PM 22/10/2002 -0400, Bruce Momjian wrote:
> >!               if (ctx->hasSeek
> >! #if !defined(HAVE_FSEEKO)
> >!                       && sizeof(off_t) <= sizeof(long)
> >! #endif
> >!                       )
> 
> Just to clarify my understanding:
> 
> - HAVE_FSEEKO is tested & defined in configure
> - If it is not defined, then all calls to fseeko will magically be 
> translated to fseek calls, and use the 'long' parameter type.
> 
> Is that right?
> 
> If so, why don't we:
> 
> #if defined(HAVE_FSEEKO)
> #define FILE_OFFSET off_t
> #define FSEEK fseeko
> #else
> #define FILE_OFFSET long
> #define FSEEK fseek
> #end if
> 
> then replace all refs to off_t with FILE_OFFSET, and fseeko with FSEEK.
> 
> Existing checks etc will then refuse to load file offsets with significant 
> bytes after the 4th byte, we will still use fseek/o in broken OS 
> implementations of off_t.

Uh, not exactly.  I have off_t as a quad, and I don't have fseeko, so
the above conditional doesn't work. I want to use off_t, but can't use
fseek().  As it turns out, the code already has options to handle no
fseek, so it seems to work anyway.  I think what you miss may be the
table of contents in the archive, if I am reading the code correctly.

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


pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: pg_dump and large files - is this a problem?
Next
From: Philip Warner
Date:
Subject: Re: pg_dump and large files - is this a problem?