pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql@mohawksoft.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: Binary Cursors, and the COPY command
Date: Mon, 26 Jul 2004 14:11:38 -0400
Message-ID: <6334.1090865498@sss.pgh.pa.us> (raw)
In-Reply-To: <10519.64.119.142.34.1090863707.squirrel@mail.mohawksoft.com>
References: <10519.64.119.142.34.1090863707.squirrel@mail.mohawksoft.com>

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



view thread (15+ messages)  latest in thread

Message-ID: <6334.1090865498@sss.pgh.pa.us>
Permalink:  ../6334.1090865498@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/6334.1090865498@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql@mohawksoft.com, pgsql-hackers@postgresql.org
  Subject: Re: Binary Cursors, and the COPY command
  In-Reply-To: <6334.1090865498@sss.pgh.pa.us>
  References: <10519.64.119.142.34.1090863707.squirrel@mail.mohawksoft.com> <6334.1090865498@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox