From dmitigr@gmail.com Mon Jun 1 08:15:52 2026 Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id EF5999BD82C for ; Mon, 5 Dec 2011 07:53:36 -0400 (AST) Received: from mail-fx0-f46.google.com ([209.85.161.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RXX72-0004Cw-TU for pgsql-docs@postgresql.org; Mon, 05 Dec 2011 11:53:37 +0000 Received: by faar15 with SMTP id r15so457428faa.19 for ; Mon, 05 Dec 2011 03:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; bh=ekPw/YN8dvwlHP/fEGaPHhvBasdFYgKzdptpJgx/DYA=; b=J2XzPclRM5rYcmL9wE6aumRDIu1M4yeUtZYq0DG1wIPDxnRP3N9PJ7uxrQmwWloycr fbpmpnzaM5IJiE+DCMlfYysGmRkBNuH5c6mHMgt/0+nY4YIOLjREgXq0vVuzjeetT0s/ +uO4gHwaO/s6Mc+Q9nvnQg8FEz1KXmt5G+NiE= MIME-Version: 1.0 Received: by 10.180.77.42 with SMTP id p10mr12499801wiw.66.1323086002347; Mon, 05 Dec 2011 03:53:22 -0800 (PST) Received: by 10.216.134.207 with HTTP; Mon, 5 Dec 2011 03:53:22 -0800 (PST) Date: Mon, 5 Dec 2011 14:53:22 +0300 Message-ID: Subject: Clarification suggestion for 46.4 chapter. From: Dmitriy Igrishin To: pgsql-docs Content-Type: multipart/alternative; boundary=f46d043c7dd02d5d5404b356f797 X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201112/12 X-Sequence-Number: 7119 --f46d043c7dd02d5d5404b356f797 Content-Type: text/plain; charset=UTF-8 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. --f46d043c7dd02d5d5404b356f797 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hey,

The section 46.4 describes the base data types used in messages.
http://www.postgresql.org/docs/9.1/static/protocol-me= ssage-types.html

According to section 46.5
http://ww= w.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 descriptio= n of Int(i)
from
"An n-bit int= eger in network byte order ..."
to
"An n-bit signed integer in network byte order ..."

--
// Dmitriy= .


--f46d043c7dd02d5d5404b356f797-- From bruce@momjian.us Mon Jun 1 08:15:52 2026 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T2ByM-0001fv-LL for pgsql-docs@postgresql.org; Fri, 17 Aug 2012 02:07:38 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T2ByK-0001Va-Pp for pgsql-docs@postgresql.org; Fri, 17 Aug 2012 02:07:37 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1T2ByJ-00022v-U1; Thu, 16 Aug 2012 22:07:35 -0400 Date: Thu, 16 Aug 2012 22:07:35 -0400 From: Bruce Momjian To: Dmitriy Igrishin Cc: pgsql-docs Subject: Re: Clarification suggestion for 46.4 chapter. Message-ID: <20120817020735.GQ30286@momjian.us> References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="mvpLiMfbWzRoNl4x" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201208/29 X-Sequence-Number: 7422 --mvpLiMfbWzRoNl4x Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + --mvpLiMfbWzRoNl4x Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="int.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 **** ! An n-bit integer in network byte order (most significant byte first). If i is specified it is the exact value that will appear, otherwise the value --- 1819,1825 ---- ! An n-bit signed integer in network byte order (most significant byte first). If i is specified it is the exact value that will appear, otherwise the value --mvpLiMfbWzRoNl4x-- From heikki.linnakangas@enterprisedb.com Mon Jun 1 08:15:52 2026 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T2IKa-0002jb-Pn for pgsql-docs@postgresql.org; Fri, 17 Aug 2012 08:55:00 +0000 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T2IKY-0002xq-3a for pgsql-docs@postgresql.org; Fri, 17 Aug 2012 08:54:59 +0000 Received: by lagy9 with SMTP id y9so1972886lag.19 for ; Fri, 17 Aug 2012 01:54:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=k6hmPUCdJcsRSYM3k+bQnft0szxZVf7tMkGEKRpKkP0=; b=kUHkfrp1eXu09QpwFRIe9w19CwkZbvPKDXqqwY1irDrI9kS94QC3ZUS8do3pJbJ1uw HBTXN+vDum8R1v3G7oxArKy6zy7v0lvPpPr+JA+yCYmw9ldXPlpEo4wLuVdRc8litCIA FddzNbsq5HfejYrDNZkaWMU4f2hc0oYEj3P3AFMi7ZjoNq7on1ZGQH5vkj1oZoBwAzJJ nUmJAjb10hxomW13CTmFXfVDOhzIVaFdak29gMr04tffvU3OHi0eE7oPSeewBcdYEY5W Va1lpMVPj7tG4nNnT2264JkyxkQqV/ocKmum98iT3mbFB94HWrV6vl0j74d02ySwCCrR D6bQ== Received: by 10.152.105.173 with SMTP id gn13mr4150017lab.20.1345193696117; Fri, 17 Aug 2012 01:54:56 -0700 (PDT) Received: from [192.168.1.101] (dsl-hkibrasgw2-fedadf00-197.dhcp.inet.fi. [80.223.218.197]) by mx.google.com with ESMTPS id p2sm1587899lbj.4.2012.08.17.01.54.54 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 17 Aug 2012 01:54:55 -0700 (PDT) Message-ID: <502E06DE.7090206@enterprisedb.com> Date: Fri, 17 Aug 2012 11:54:54 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120624 Icedove/10.0.5 MIME-Version: 1.0 To: Bruce Momjian CC: Dmitriy Igrishin , pgsql-docs Subject: Re: Clarification suggestion for 46.4 chapter. References: <20120817020735.GQ30286@momjian.us> In-Reply-To: <20120817020735.GQ30286@momjian.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkVm8GBLNyTbt0sZ4s3P/EUFuSMTnNON+zvozUw6y7bCQc74tyPGHaJ2WoQ7+5L7uPXnLrY X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201208/30 X-Sequence-Number: 7423 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 From bruce@momjian.us Mon Jun 1 08:15:52 2026 Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T7qCO-00075Y-M5 for pgsql-docs@postgresql.org; Sat, 01 Sep 2012 16:05:28 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T7qCL-00088a-JZ for pgsql-docs@postgresql.org; Sat, 01 Sep 2012 16:05:28 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1T7qCK-0004Gm-0M; Sat, 01 Sep 2012 12:05:24 -0400 Date: Sat, 1 Sep 2012 12:05:24 -0400 From: Bruce Momjian To: Heikki Linnakangas Cc: Dmitriy Igrishin , pgsql-docs Subject: Re: Clarification suggestion for 46.4 chapter. Message-ID: <20120901160523.GD2969@momjian.us> References: <20120817020735.GQ30286@momjian.us> <502E06DE.7090206@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <502E06DE.7090206@enterprisedb.com> User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -2.1 (--) X-Archive-Number: 201209/1 X-Sequence-Number: 7453 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 http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +