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

From: PG Doc comments form <noreply(at)postgresql(dot)org>
To: pgsql-docs(at)lists(dot)postgresql(dot)org
Cc: roji(at)roji(dot)org
Subject: Signed-ness of ints is unclear in FE-BE protocol docs
Date: 2020-06-09 21:35:41
Message-ID: 159173854100.661.1819403154632752741@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/12/protocol-message-types.html
Description:

Hi, I'm the maintainer of Npgsql, the .NET open source driver for
PostgreSQL.

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).
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.

Thanks!

Shay
Shay

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Melanie Plageman 2020-06-10 01:20:13 Re: Default setting for enable_hashagg_disk
Previous Message PG Doc comments form 2020-06-09 21:34:17 some charts or graphs of possible permissions would be nice