Re: Signed-ness of ints is unclear in FE-BE protocol docs

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: roji(at)roji(dot)org, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Signed-ness of ints is unclear in FE-BE protocol docs
Date: 2020-06-11 17:39:55
Message-ID: b6eb1e01-7ed3-37a6-e1f9-3b270236f1e7@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On 2020-06-09 23:35, PG Doc comments form wrote:
> The protocol docs generally do not mention whether ints are signed or
> unsigned - this has actually bitten me once in the past, where a signed int
> was accidentally used to interpret an unsigned int coming from PostgreSQL,
> leading to issues. The ambiguity has made me resort to inspecting the
> PostgreSQL sources in order to be sure.
>
> First, I'd consider clarifying this on the "Message Data Types" page
> (https://www.postgresql.org/docs/current/protocol-message-types.html)

sure

> Second, across the protocol docs, rather than using Int32 and Int64, which
> generally look like they're signed (depending on which language you're
> coming from), I'd consider using UInt32/UInt64, which are unambiguous with
> regards to signed-ness.

Well, they are actually signed, so I'm confused why you think we should
change the documentation to unsigned.

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Shay Rojansky 2020-06-11 18:06:52 Re: Signed-ness of ints is unclear in FE-BE protocol docs
Previous Message Jürgen Purtz 2020-06-11 08:19:50 Re: some charts or graphs of possible permissions would be nice