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

From Tom Lane
Subject Re: pg_dump and large files - is this a problem?
Date
Msg-id 17619.1035293362@sss.pgh.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?  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
Philip Warner <pjw@rhyme.com.au> writes:
> None, but it will be compatible with itself (the most we can hope for), and 
> will work even if shifting is not supported for off_t (how likely is 
> that?). I agree shift is definitely the way to go if it works on arbitrary 
> data - ie. it does not rely on off_t being an integer. Can I shift a struct?

You can't.  If there are any platforms where in fact off_t isn't an
arithmetic type, then shifting code would break there.  I am not sure
there are any; can anyone provide a counterexample?

It would be simple enough to add a configure test to see whether off_t
is arithmetic (just try to compile "off_t x; x <<= 8;").  How about#ifdef OFF_T_IS_ARITHMETIC_TYPE    // cross-platform
compatible   use shifting method#else    // not cross-platform compatible    read or write bytes of struct in storage
order#endif
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: New SET/autocommit problem
Next
From: Tom Lane
Date:
Subject: Re: Current CVS is broken