Re: BUG #4053: libpq documentation should express clearly, that integers are passed in network octet order

Lists: pgsql-bugs
From: "Aleksej Saushev" <asau(at)inbox(dot)ru>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #4053: libpq documentation should express clearly, that integers are passed in network octet order
Date: 2008-03-24 18:12:48
Message-ID: 200803241812.m2OICmbm048484@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 4053
Logged by: Aleksej Saushev
Email address: asau(at)inbox(dot)ru
PostgreSQL version: 8.3
Operating system: NetBSD, but this does no matter
Description: libpq documentation should express clearly, that
integers are passed in network octet order
Details:

The documentation on PQexecParams is silent about the precise format,
expected by server for binary parameters, it should be more explicit
and note that integers are expected in network octet order.


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Aleksej Saushev <asau(at)inbox(dot)ru>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4053: libpq documentation should express clearly, that integers are passed in network octet order
Date: 2008-05-08 02:20:57
Message-ID: 200805080220.m482KvR08948@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Aleksej Saushev wrote:
>
> The following bug has been logged online:
>
> Bug reference: 4053
> Logged by: Aleksej Saushev
> Email address: asau(at)inbox(dot)ru
> PostgreSQL version: 8.3
> Operating system: NetBSD, but this does no matter
> Description: libpq documentation should express clearly, that
> integers are passed in network octet order
> Details:
>
> The documentation on PQexecParams is silent about the precise format,
> expected by server for binary parameters, it should be more explicit
> and note that integers are expected in network octet order.

This brings up a good question. Exactly how do users know what format
_binary_ is? int4 is network byte order, but what about int8, float4,
inet?

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +


From: Andrew Chernow <ac(at)esilo(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Aleksej Saushev <asau(at)inbox(dot)ru>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4053: libpq documentation should express clearly, that integers are passed in network octet order
Date: 2008-05-08 02:36:58
Message-ID: 4822674A.7070007@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Bruce Momjian wrote:
> Aleksej Saushev wrote:
>> The following bug has been logged online:
>>
>> Bug reference: 4053
>> Logged by: Aleksej Saushev
>> Email address: asau(at)inbox(dot)ru
>> PostgreSQL version: 8.3
>> Operating system: NetBSD, but this does no matter
>> Description: libpq documentation should express clearly, that
>> integers are passed in network octet order
>> Details:
>>
>> The documentation on PQexecParams is silent about the precise format,
>> expected by server for binary parameters, it should be more explicit
>> and note that integers are expected in network octet order.
>
> This brings up a good question. Exactly how do users know what format
> _binary_ is? int4 is network byte order, but what about int8, float4,
> inet?
>

They don't have to if they use the libpqtypes library :)

project: http://pgfoundry.org/projects/libpqtypes/
online docs: http://libpqtypes.esilo.com/

andrew


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Aleksej Saushev <asau(at)inbox(dot)ru>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #4053: libpq documentation should express clearly, that integers are passed in network octet order
Date: 2008-06-23 21:11:35
Message-ID: 200806232111.m5NLBZe12886@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-bugs

Aleksej Saushev wrote:
>
> The following bug has been logged online:
>
> Bug reference: 4053
> Logged by: Aleksej Saushev
> Email address: asau(at)inbox(dot)ru
> PostgreSQL version: 8.3
> Operating system: NetBSD, but this does no matter
> Description: libpq documentation should express clearly, that
> integers are passed in network octet order
> Details:
>
> The documentation on PQexecParams is silent about the precise format,
> expected by server for binary parameters, it should be more explicit
> and note that integers are expected in network octet order.

I have added this libpq documentation paragraph about how to determine
how to pass binary values. I also added a few comments to the libpq C
code.

Thanks for the report; please let me know if I can improve it more.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

Attachment Content-Type Size
/rtmp/diff text/x-diff 2.1 KB