Re: Checking for overflow of integer arithmetic

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Checking for overflow of integer arithmetic
Date: 2004-10-03 23:29:42
Message-ID: 20041003232942.GA24542@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Oct 03, 2004 at 15:38:52 -0400,
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> 1. Does anyone object to applying this for 8.0? I think we already had
> consensus that it's a good idea, but if not now's the time to speak up.
> (There are a couple of regression tests that fail and will need to be
> adjusted, if that influences anyone's thinking.)

I think this should go in. I think not detecting overflow is really a bug.

> 2. For the int2 and int8 operators, should we stick to a one-size-fits-all
> message "integer out of range", or be more specific: "smallint out of
> range" and "bigint out of range"? The existing messages are not
> completely consistent about this. I'm inclined to go with mentioning
> the specific type but I'm not dead set on it.

I think giving the type info will be helpful for debugging.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gaetano Mendola 2004-10-04 00:11:46 Re: Checking for overflow of integer arithmetic
Previous Message Tom Lane 2004-10-03 22:37:44 Re: Mislabeled timestamp functions (was Re: [SQL] [NOVICE] date_trunc'd timestamp index possible?)