From: pgsql@mohawksoft.com
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql@mohawksoft.com
Cc: pgsql-hackers@postgresql.org
Subject: Re: Binary Cursors, and the COPY command
Date: Mon, 26 Jul 2004 22:06:28 -0400 (EDT)
Message-ID: <17868.24.91.171.78.1090893988.squirrel@mail.mohawksoft.com> (raw)
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>
> 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.
So what you are saying is that you should inconvenience 90% of your users
to make sure they do something "right?"
When you *really* think about it, by forcing a big endian byte order over
machine dependent byte order, you are inconveniencing 90% of the users,
but only helping the very small amount of people who run in mixed
environments where the server is intel and the client is big endian.
>
> 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.)
While I understand your lack of sympathy, I think you are too removed from
the trenches. There is a viable argument in many projects for machine
dependent constructs. Sometimes there are real-world performance and
delivery goals with absolutely stated objectives that the project is not
heterogenus.
>
> If you don't want to deal with this, don't use binary data. It's as
> simple as that.
That's not a good answer either. Come on, what the hell good is having a
"BINARY" if the data is not usable? Using ascii isn't good either because
you need a text parser for every possible interpretation of the various
simple types.
>
> 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.
Few deployments will *ever* really have different endian-ness amongst
their servers. 99% of all deployments will be the same or compatible
hardware, and probably intel at that.
OK, so you like the idea of binary being "big endian," what about the idea
of adding a keyword that is exclusive of "binary" called "native" or
something like that?
DECLARE fubar NATIVE CURSOR ...
COPY fubar {FROM | TO} {'filename' | STD..} WITH [NATIVE | BINARY] ...
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: pgsql@mohawksoft.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
Subject: Re: Binary Cursors, and the COPY command
In-Reply-To: <17868.24.91.171.78.1090893988.squirrel@mail.mohawksoft.com>
References: <10519.64.119.142.34.1090863707.squirrel@mail.mohawksoft.com> <6334.1090865498@sss.pgh.pa.us> <17868.24.91.171.78.1090893988.squirrel@mail.mohawksoft.com>
* 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