pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mikko Tiihonen <mikko.tiihonen@iki.fi>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: aaime74 <andrea.aime@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Status of binary protocol usage?
Date: Thu, 19 Jul 2007 15:27:08 +0300
Message-ID: <1184848028.1632.25.camel@dual.local> (raw)

tom lane wrote:
> aaime74 <andrea ( dot ) aime ( at ) gmail ( dot ) com> writes:
> > Hum, interesting. What would be the boatload of disadvantages?
>
> Portability and cross-machine compatibility, or lack of same.

I can understand that future postgres versions can change the binary
protocol, but I hope it is done so that it can be deduced from the
version or alternatively similarly to the float/long timestamp
so that the server informs about its usage of new features.

But I cannot understand why the protocol would be allowed to ever
vary with the server 32/64bitness or endiandness. And at least to my
current understanding it doesn't. And if those are taken care of
in the server side then there shouldn't be any problems because the
java side by definition already is cross-machine compatible and portable.

But if you really think that the binary protocol varies so much with the
server then why is it documented (even as much as it is) and why is the
documentation warning about the possible compatibility problems.

> It's tough enough trying to make things work for relatively primitive
> datatypes like float.  I can hardly imagine that anyone would want to
> support binary representations across platforms for geometric types.

I think that is why the postgres binary protocol allows requesting use
of binary types for each input and output parameter separately.
In addition the jdbc driver (with my proposed patches) allows
controlling binary/text format of each type separately to work around any
future changes in the protocol.

In the proposed binary protocol changes one just needs to add a few
lines code to send or receive path (which ever is the bottleneck) whenever
a new datatype that is performance critical for an application is found.

Anyway, I seem to have vanished for half a year but I could try to pick up
things from where I left them. Kris had some good ideas on how to hack
the test framework in order to ensure that the binary patches would not
cause any regressions.

-Mikko





view thread (5+ messages)

Message-ID: <1184848028.1632.25.camel@dual.local>
Permalink:  ../1184848028.1632.25.camel@dual.local/
Also on:    postgresql.org/message-id/1184848028.1632.25.camel@dual.local

 · 

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: mikko.tiihonen@iki.fi, tgl@sss.pgh.pa.us, andrea.aime@gmail.com
  Subject: Re: Status of binary protocol usage?
  In-Reply-To: <1184848028.1632.25.camel@dual.local>
  References: <1184848028.1632.25.camel@dual.local>

* 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