public inbox for [email protected]
help / color / mirror / Atom feedClarification suggestion for 46.4 chapter.
4+ messages / 3 participants
[nested] [flat]
* Clarification suggestion for 46.4 chapter.
@ 2011-12-05 11:53 Dmitriy Igrishin <[email protected]>
2012-08-17 02:07 ` Re: Clarification suggestion for 46.4 chapter. Bruce Momjian <[email protected]>
0 siblings, 1 reply; 4+ messages in thread
From: Dmitriy Igrishin @ 2011-12-05 11:53 UTC (permalink / raw)
To: pgsql-docs
Hey,
The section 46.4 describes the base data types used in messages.
http://www.postgresql.org/docs/9.1/static/protocol-message-types.html
According to section 46.5
http://www.postgresql.org/docs/9.1/static/protocol-message-formats.html
there are cases when Int32 can be negative (e.g. see DataRow(B) message
description.)
Thus, I would like to suggest to change the description of Int(i)
from
"An n-bit integer in network byte order ..."
to
"An n-bit signed integer in network byte order ..."
--
// Dmitriy.
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Clarification suggestion for 46.4 chapter.
2011-12-05 11:53 Clarification suggestion for 46.4 chapter. Dmitriy Igrishin <[email protected]>
@ 2012-08-17 02:07 ` Bruce Momjian <[email protected]>
2012-08-17 08:54 ` Re: Clarification suggestion for 46.4 chapter. Heikki Linnakangas <[email protected]>
0 siblings, 1 reply; 4+ messages in thread
From: Bruce Momjian @ 2012-08-17 02:07 UTC (permalink / raw)
To: Dmitriy Igrishin <[email protected]>; +Cc: pgsql-docs
On Mon, Dec 5, 2011 at 02:53:22PM +0300, Dmitriy Igrishin wrote:
> Hey,
>
> The section 46.4 describes the base data types used in messages.
> http://www.postgresql.org/docs/9.1/static/protocol-message-types.html
>
> According to section 46.5
> http://www.postgresql.org/docs/9.1/static/protocol-message-formats.html
> there are cases when Int32 can be negative (e.g. see DataRow(B) message
> description.)
>
> Thus, I would like to suggest to change the description of Int(i)
> from
> "An n-bit integer in network byte order ..."
> to
> "An n-bit signed integer in network byte order ..."
OK, documentation updated.
--
Bruce Momjian <[email protected]> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
Attachments:
[text/x-diff] int.diff (893B, 2-int.diff)
download | inline diff:
diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml
new file mode 100644
index e725563..8778c58
*** a/doc/src/sgml/protocol.sgml
--- b/doc/src/sgml/protocol.sgml
*************** This section describes the base data typ
*** 1819,1825 ****
</term>
<listitem>
<para>
! An <replaceable>n</replaceable>-bit integer in network byte
order (most significant byte first).
If <replaceable>i</replaceable> is specified it
is the exact value that will appear, otherwise the value
--- 1819,1825 ----
</term>
<listitem>
<para>
! An <replaceable>n</replaceable>-bit signed integer in network byte
order (most significant byte first).
If <replaceable>i</replaceable> is specified it
is the exact value that will appear, otherwise the value
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Clarification suggestion for 46.4 chapter.
2011-12-05 11:53 Clarification suggestion for 46.4 chapter. Dmitriy Igrishin <[email protected]>
2012-08-17 02:07 ` Re: Clarification suggestion for 46.4 chapter. Bruce Momjian <[email protected]>
@ 2012-08-17 08:54 ` Heikki Linnakangas <[email protected]>
2012-09-01 16:05 ` Re: Clarification suggestion for 46.4 chapter. Bruce Momjian <[email protected]>
0 siblings, 1 reply; 4+ messages in thread
From: Heikki Linnakangas @ 2012-08-17 08:54 UTC (permalink / raw)
To: Bruce Momjian <[email protected]>; +Cc: Dmitriy Igrishin <[email protected]>; pgsql-docs
On 17.08.2012 05:07, Bruce Momjian wrote:
> On Mon, Dec 5, 2011 at 02:53:22PM +0300, Dmitriy Igrishin wrote:
>> Hey,
>>
>> The section 46.4 describes the base data types used in messages.
>> http://www.postgresql.org/docs/9.1/static/protocol-message-types.html
>>
>> According to section 46.5
>> http://www.postgresql.org/docs/9.1/static/protocol-message-formats.html
>> there are cases when Int32 can be negative (e.g. see DataRow(B) message
>> description.)
>>
>> Thus, I would like to suggest to change the description of Int(i)
>> from
>> "An n-bit integer in network byte order ..."
>> to
>> "An n-bit signed integer in network byte order ..."
>
> OK, documentation updated.
Actually, in some cases the integers are signed, and in others unsigned.
For example, in a Bind('F') message, the number of parameters is an
Int16 according to the docs, but it is treated as unsigned. The maximum
number of parameters is 65535.
The sentence used to be factually correct, when it didn't mention
whether they're signed or unsigned. If we want to do better than that,
we'd need to go through all the mentions of IntN in the docs and
explicitly say which ones are signed and which ones unsigned. Perhaps
use Uint16 or Uint32 for the unsigned ones.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Clarification suggestion for 46.4 chapter.
2011-12-05 11:53 Clarification suggestion for 46.4 chapter. Dmitriy Igrishin <[email protected]>
2012-08-17 02:07 ` Re: Clarification suggestion for 46.4 chapter. Bruce Momjian <[email protected]>
2012-08-17 08:54 ` Re: Clarification suggestion for 46.4 chapter. Heikki Linnakangas <[email protected]>
@ 2012-09-01 16:05 ` Bruce Momjian <[email protected]>
0 siblings, 0 replies; 4+ messages in thread
From: Bruce Momjian @ 2012-09-01 16:05 UTC (permalink / raw)
To: Heikki Linnakangas <[email protected]>; +Cc: Dmitriy Igrishin <[email protected]>; pgsql-docs
On Fri, Aug 17, 2012 at 11:54:54AM +0300, Heikki Linnakangas wrote:
> On 17.08.2012 05:07, Bruce Momjian wrote:
> >On Mon, Dec 5, 2011 at 02:53:22PM +0300, Dmitriy Igrishin wrote:
> >>Hey,
> >>
> >>The section 46.4 describes the base data types used in messages.
> >>http://www.postgresql.org/docs/9.1/static/protocol-message-types.html
> >>
> >>According to section 46.5
> >>http://www.postgresql.org/docs/9.1/static/protocol-message-formats.html
> >>there are cases when Int32 can be negative (e.g. see DataRow(B) message
> >>description.)
> >>
> >>Thus, I would like to suggest to change the description of Int(i)
> >>from
> >>"An n-bit integer in network byte order ..."
> >>to
> >>"An n-bit signed integer in network byte order ..."
> >
> >OK, documentation updated.
>
> Actually, in some cases the integers are signed, and in others
> unsigned. For example, in a Bind('F') message, the number of
> parameters is an Int16 according to the docs, but it is treated as
> unsigned. The maximum number of parameters is 65535.
>
> The sentence used to be factually correct, when it didn't mention
> whether they're signed or unsigned. If we want to do better than
> that, we'd need to go through all the mentions of IntN in the docs
> and explicitly say which ones are signed and which ones unsigned.
> Perhaps use Uint16 or Uint32 for the unsigned ones.
I have reverted the patch until someone is able to correctly designate
the values. Thanks.
--
Bruce Momjian <[email protected]> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ It's impossible for everything to be true. +
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2012-09-01 16:05 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2011-12-05 11:53 Clarification suggestion for 46.4 chapter. Dmitriy Igrishin <[email protected]>
2012-08-17 02:07 ` Bruce Momjian <[email protected]>
2012-08-17 08:54 ` Heikki Linnakangas <[email protected]>
2012-09-01 16:05 ` Bruce Momjian <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox