Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1meGww-0001X2-Rt for pgsql-docs@arkaria.postgresql.org; Sat, 23 Oct 2021 13:20:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1meGws-00033u-KL for pgsql-docs@arkaria.postgresql.org; Sat, 23 Oct 2021 13:20:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mdzhi-0005iD-LB for pgsql-docs@lists.postgresql.org; Fri, 22 Oct 2021 18:55:46 +0000 Received: from c.mail.sonic.net ([64.142.111.80]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mdzhb-0003a6-HB; Fri, 22 Oct 2021 18:55:45 +0000 Received: from [192.168.101.109] (157-131-249-223.fiber.dynamic.sonic.net [157.131.249.223]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id 19MItX29009777 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128 verify=NOT); Fri, 22 Oct 2021 11:55:33 -0700 Message-ID: <41540ed2-5ef9-8b46-6706-9baeb58b8851@teews.com> Date: Fri, 22 Oct 2021 11:55:33 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: documentation describing the range of a number type 'integer' is incorrect Content-Language: en-US To: Alvaro Herrera , pgsql-docs@lists.postgresql.org Cc: Michael Meskes References: <202110221343.rgmrpm6sy3be@alvherre.pgsql> From: Kevin Sweet In-Reply-To: <202110221343.rgmrpm6sy3be@alvherre.pgsql> Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Sonic-CAuth: UmFuZG9tSVYey0AVTwh92tV0Tse6XTimwfw03oHyDweIghdxig5jDs1alefxF6WGbbhkhlkEhRog9Kakn2gwo70YyNABT3wW X-Sonic-ID: C;kLO7omkz7BG0hSx66Nu5DA== M;LMnSomkz7BG0hSx66Nu5DA== X-Spam-Flag: No X-Sonic-Spam-Details: -1.6/5.0 by cerberusd List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk The bugs team agreed that it's a bug. The documentation accurately represents the buggy code. I thought you might want to update the doc when the bug is fixed.


On 10/22/21 6:43 AM, Alvaro Herrera wrote:
On 2021-Jul-29, PG Doc comments form wrote:

https://www.postgresql.org/docs/13/datatype-numeric.html says that the range
of a numeric type integer is -2147483648 to +2147483647 but
PGTYPESnumeric_to_int considers -2147483648 (a perfectly valid 32-bit
integer) to be invalid because it compares to -INT_MAX instead of INT_MIN or
(-INT_MAX - 1). This goes back to the initial commit in the git repo for
src/interfaces/ecpg/pgtypeslib/numeric.c. And doc/src/sgml/ecpg.sgml
documents the min being -INT_MAX.
This sounds like an ECPG bug, not a documentation problem.