From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Naylor <john.naylor@enterprisedb.com>
Cc: kjs@teews.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17128: minimum numeric 'integer' is -2147483647 not -2147483648 as documented
Date: Fri, 30 Jul 2021 11:14:32 -0400
Message-ID: <1003602.1627658072@sss.pgh.pa.us> (raw)
In-Reply-To: <CAFBsxsEf6qMvYf5WbDOUdr57mGq18La21R4wNr5=zm4C-1vs6A@mail.gmail.com>
References: <17128-55a8a879727a3e3a@postgresql.org>
<CAFBsxsEf6qMvYf5WbDOUdr57mGq18La21R4wNr5=zm4C-1vs6A@mail.gmail.com>
John Naylor <john.naylor@enterprisedb.com> writes:
> On Fri, Jul 30, 2021 at 7:53 AM PG Bug reporting form <
> noreply@postgresql.org> wrote:
>> - if (l < -INT_MAX || l > INT_MAX)
>> + if (l < (-INT_MAX - 1) || l > INT_MAX)
> Yeah, that looks like it should be INT_MIN instead. I'll see about making
> that happen. Thanks for the report!
The whole stanza perhaps ought to be within
#if SIZEOF_LONG > SIZEOF_INT
otherwise some compilers will bleat about useless tests.
(I looked at PGTYPESnumeric_to_long and it seems like it will do
the right thing for 32-bit long, assuming strtol does.)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, john.naylor@enterprisedb.com, kjs@teews.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17128: minimum numeric 'integer' is -2147483647 not -2147483648 as documented
In-Reply-To: <1003602.1627658072@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox