Re: Binary Cursors, and the COPY command - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Binary Cursors, and the COPY command
Date
Msg-id 6334.1090865498@sss.pgh.pa.us
Whole thread Raw
In response to Binary Cursors, and the COPY command  (pgsql@mohawksoft.com)
Responses Re: Binary Cursors, and the COPY command  (pgsql@mohawksoft.com)
List pgsql-hackers
pgsql@mohawksoft.com writes:
> Lastly, the vast majority of machines in use today are intel. Meaning that
> they are small endian. Except in a very rare circumstance, two machines
> that would normally be able to communicate in native byte order, will
> ALWAYS have to convert data.

Quite honestly, that is exactly one of the reasons for using network
order.  If we standardized on little-endian then 90% of programmers
would ignore the need to do anything about byte ordering issues, and
their code would be unportable to big-endian machines.

Putting a byte order flag into the header doesn't improve matters;
it just forces everybody to deal with *both* orders, which is not
simpler.  (Except for those who would like not to be bothered with
portability, which is a position I have zero sympathy for.)

If you don't want to deal with this, don't use binary data.  It's as
simple as that.

BTW, for your stated use-case of combining binary output from separate
databases, I should think you'd be happy about having a not-so-machine-
dependent data format.  It would still work if the databases were
running on servers of different endianness.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Marc G. Fournier"
Date:
Subject: Re: CVS web interface error
Next
From: Brian Hirt
Date:
Subject: WARNING: buffer refcount leak