Re: libpq 7.4 and binary cursor

Поиск
Список
Период
Сортировка
От L J Bayuk
Тема Re: libpq 7.4 and binary cursor
Дата
Msg-id 200406102344.i5ANis8w000268@mindspring.com
обсуждение исходный текст
Ответ на libpq 7.4 and binary cursor  (Stephane Raimbault <stephane.raimbault@free.fr>)
Список pgsql-interfaces
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.


В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Terry Lee Tucker
Дата:
Сообщение: Locking Question
Следующее
От: Eliot Simcoe
Дата:
Сообщение: libpq binary transfer of the numeric data type