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 200210221626.g9MGQU402938@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?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Philip Warner wrote:
> At 12:00 PM 22/10/2002 -0400, Bruce Momjian wrote:
> >It does have the advantage of being more portable on systems
> >that do have integral off_t
> 
> I suspect it is no more portable than determining storage order by using 
> 'int i = 256', then writing in storage order, and has the disadvantage that 
> it may break as discussed.
> 
> AFAICT, using storage order will not break under any circumstances within 
> one OS/architecture (unlike using shift), and will not break any more often 
> than using shift in cases where off_t is integral.

Your version will break more often because we are assuming we can
determine the endian-ness of the OS, _and_ for quad off_t types,
assuming we know that is stored the same too.  While we have ending for
int's, I have no idea if quads are always stored the same.  By accessing
it as an integral type, we make certain it is output the same way every
time for every OS.

--  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: Tom Lane
Date:
Subject: Re: pg_dump and large files - is this a problem?
Next
From: Bruce Momjian
Date:
Subject: Re: pg_dump and large files - is this a problem?