pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: L J Bayuk <ljb220@mindspring.com>
To: stephane.raimbault@free.fr
Cc: pgsql-interfaces@postgresql.org
Subject: Re: libpq 7.4 and binary cursor
Date: Thu, 10 Jun 2004 19:44:54 -0400 (EDT)
Message-ID: <200406102344.i5ANis8w000268@mindspring.com> (raw)
In-Reply-To: <1086877827.4646.22.camel@picasso.lan>

Stephane Raimbault wrote:
> 
> It seems some changes occured in network protocol between 7.3 and 7.4.

Big understatement! It was completely redesigned.

> In my simple libray above libpq, I used this call to extract float8 with
> a binary cursor (on x86) :
> ...

Pre-7.4, binary data came back in the server's byte order. Starting 7.4,
data always comes back in "network data order", which is big-endian,
regardless of server or client architecture. This is a big improvement, so
you can now portably deal with binary data. The proper way to do so in the
client is to use the ntohs() and ntohl() functions to turn network data
order into native order.



view thread (5+ messages)

Message-ID: <200406102344.i5ANis8w000268@mindspring.com>
Permalink:  ../200406102344.i5ANis8w000268@mindspring.com/
Also on:    postgresql.org/message-id/200406102344.i5ANis8w000268@mindspring.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: ljb220@mindspring.com, stephane.raimbault@free.fr
  Subject: Re: libpq 7.4 and binary cursor
  In-Reply-To: <200406102344.i5ANis8w000268@mindspring.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