pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
[Patch] Binary Transfer v12
6+ messages / 4 participants
[nested] [flat]

* [Patch] Binary Transfer v12
@ 2009-06-02 13:44  Jesper Pedersen <jesper.pedersen@jboss.org>
  0 siblings, 1 reply; 6+ messages in thread

From: Jesper Pedersen @ 2009-06-02 13:44 UTC (permalink / raw)
  To: pgsql-jdbc

Hi.

I have updated the binary transfer patch against latest CVS/HEAD.

 http://wiki.postgresql.org/wiki/JDBC-BinaryTransfer

Best regards,
 Jesper



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [Patch] Binary Transfer v12
@ 2009-06-03 07:29  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Jesper Pedersen <jesper.pedersen@jboss.org>
  0 siblings, 1 reply; 6+ messages in thread

From: Albe Laurenz @ 2009-06-03 07:29 UTC (permalink / raw)
  To: Jesper Pedersen *EXTERN* <jesper.pedersen@jboss.org>; pgsql-jdbc

Jesper Pedersen wrote:
> I have updated the binary transfer patch against latest CVS/HEAD.
> 
>  http://wiki.postgresql.org/wiki/JDBC-BinaryTransfer

Sounds great!

Did you test it with both little-endian and big-endian servers?
With 32-bit and 64-bit servers?

I don't know for sure, but all this *might* affect the binary format.

Yours,
Laurenz Albe



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [Patch] Binary Transfer v12
@ 2009-06-03 08:00  Mikko Tiihonen <mikko.tiihonen@nitorcreations.com>
  parent: Albe Laurenz <laurenz.albe@wien.gv.at>
  0 siblings, 2 replies; 6+ messages in thread

From: Mikko Tiihonen @ 2009-06-03 08:00 UTC (permalink / raw)
  To: Albe Laurenz <laurenz.albe@wien.gv.at>; +Cc: Jesper Pedersen *EXTERN* <jesper.pedersen@jboss.org>; pgsql-jdbc

Albe Laurenz wrote:
> Jesper Pedersen wrote:
>> I have updated the binary transfer patch against latest CVS/HEAD.
>>
>>  http://wiki.postgresql.org/wiki/JDBC-BinaryTransfer
> 
> Sounds great!
> 
> Did you test it with both little-endian and big-endian servers?
> With 32-bit and 64-bit servers?

I have only tested with 64bit amd64 servers.

Luckily the protocol is well defined to always use network byte order:
http://developer.postgresql.org/pgdocs/postgres/protocol-message-types.html

The incompatible bits of the protocol are in feature flags.

For example the time can either be a double as seconds or long as microseconds. 
The default has just changed in 8.4, but the binary transfer patch has supported 
both since the beginning.

> I don't know for sure, but all this *might* affect the binary format.

But now you got me wondering...

The protocol messages itself are well defined, but I cannot find any 
documentation about the data value contents because there is no official 
documentation. I had to just guess how the values are stored. Based on the data 
type byte sizes in database, for example look here:
http://developer.postgresql.org/pgdocs/postgres/datatype-datetime.html

-Mikko



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [Patch] Binary Transfer v12
@ 2009-06-03 09:14  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Mikko Tiihonen <mikko.tiihonen@nitorcreations.com>
  1 sibling, 1 reply; 6+ messages in thread

From: Albe Laurenz @ 2009-06-03 09:14 UTC (permalink / raw)
  To: Mikko Tiihonen *EXTERN* <mikko.tiihonen@nitorcreations.com>; +Cc: Jesper Pedersen *EXTERN* <jesper.pedersen@jboss.org>; pgsql-jdbc

Mikko Tiihonen wrote:
>> Did you test it with both little-endian and big-endian servers?
>> With 32-bit and 64-bit servers?
> 
> I have only tested with 64bit amd64 servers.
>
[...]
> 
> But now you got me wondering...
> 
> The protocol messages itself are well defined, but I cannot find any 
> documentation about the data value contents because there is no official 
> documentation. I had to just guess how the values are stored. Based on the data 
> type byte sizes in database, for example look here:
> http://developer.postgresql.org/pgdocs/postgres/datatype-datetime.html

Unfortunately I don't know the implementation details.
Maybe binary values come as they are on disk, see the note in the COPY
documentation:
http://developer.postgresql.org/pgdocs/postgres/sql-copy.html

I have a (big-endian) AIX machine where I could test it as soon as the
patch is in. Is there a convenient test program?

Yours,
Laurenz Albe



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [Patch] Binary Transfer v12
@ 2009-06-03 15:25  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Mikko Tiihonen <mikko.tiihonen@nitorcreations.com>
  1 sibling, 0 replies; 6+ messages in thread

From: Tom Lane @ 2009-06-03 15:25 UTC (permalink / raw)
  To: Mikko Tiihonen <mikko.tiihonen@nitorcreations.com>; +Cc: Albe Laurenz <laurenz.albe@wien.gv.at>; Jesper Pedersen *EXTERN* <jesper.pedersen@jboss.org>; pgsql-jdbc

Mikko Tiihonen <mikko.tiihonen@nitorcreations.com> writes:
> The protocol messages itself are well defined, but I cannot find any 
> documentation about the data value contents because there is no official 
> documentation. I had to just guess how the values are stored.

"Use the source, Luke" ... you're supposed to consult the backend
"foo_send" and "foo_recv" routines if you are in doubt about the
on-the-wire representation of type foo.  Someday we should get around
to transposing that information into the SGML docs, but it's not a
real high-priority item.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: [Patch] Binary Transfer v12
@ 2009-06-09 16:30  Albe Laurenz <laurenz.albe@wien.gv.at>
  parent: Albe Laurenz <laurenz.albe@wien.gv.at>
  0 siblings, 0 replies; 6+ messages in thread

From: Albe Laurenz @ 2009-06-09 16:30 UTC (permalink / raw)
  To: Albe Laurenz <laurenz.albe@wien.gv.at>; Mikko Tiihonen *EXTERN* <mikko.tiihonen@nitorcreations.com>; +Cc: Jesper Pedersen *EXTERN* <jesper.pedersen@jboss.org>; pgsql-jdbc

I wrote:
> >> Did you test it with both little-endian and big-endian servers?
> >> With 32-bit and 64-bit servers?
> > 
> > I have only tested with 64bit amd64 servers.
> >
> [...]
> > 
> > But now you got me wondering...
> > 
> > The protocol messages itself are well defined, but I cannot find any 
> > documentation about the data value contents because there is no official 
> > documentation. I had to just guess how the values are stored. Based on the data 
> > type byte sizes in database, for example look here:
> > 
> http://developer.postgresql.org/pgdocs/postgres/datatype-datetime.html
> 
> Unfortunately I don't know the implementation details.
> Maybe binary values come as they are on disk, see the note in the COPY
> documentation:
> http://developer.postgresql.org/pgdocs/postgres/sql-copy.html
> 
> I have a (big-endian) AIX machine where I could test it as soon as the
> patch is in. Is there a convenient test program?

I tried to select int2, int4, int8 and float8 on both 32-bit Linux and
64-bit AIX, and the binary representations for all the values were
identical. Looks good, but it is only a small test sample.

Yours,
Laurenz Albe



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2009-06-09 16:30 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-06-02 13:44 [Patch] Binary Transfer v12 Jesper Pedersen <jesper.pedersen@jboss.org>
2009-06-03 07:29 ` Albe Laurenz <laurenz.albe@wien.gv.at>
2009-06-03 08:00   ` Mikko Tiihonen <mikko.tiihonen@nitorcreations.com>
2009-06-03 09:14     ` Albe Laurenz <laurenz.albe@wien.gv.at>
2009-06-09 16:30       ` Albe Laurenz <laurenz.albe@wien.gv.at>
2009-06-03 15:25     ` Tom Lane <tgl@sss.pgh.pa.us>

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