Seems this is not a bug.
Although 32767 doesn't exceed the 2bit int range.
But (32767 + 10) exceed the signed 2bit int range.
If you want to add index for the sum of the 2 columns, why don't you add a new
column with a larger range (int32) ?
-- Original --
From:
On 5.8.2012 07:14, Mike Christensen wrote:
> First off, I've posted this question on StackOverflow in case anyone
> wants to answer it:
>
> http://stackoverflow.com/questions/11814132/postgresql-smallint-
> overflowing-when-creating-index-on-multiple-columns-is-th
>
> The repro can be found here:
>> First off, I've posted this question on StackOverflow in case anyone
>> wants to answer it:
>>
>> http://stackoverflow.com/questions/11814132/postgresql-smallint-
>> overflowing-when-creating-index-on-multiple-columns-is-th
>>
>> The repro can be found here: http://sqlfiddle.com/#!1/734d7/1
>>
>
On Sat, Jul 28, 2012 at 2:00 AM, Ben Chobot wrote:
> We make heavy use of streaming replication on PG 9.1 and it's been great for
> us. We do have one issue with it, though, and that's when we switch master
> nodes - currently, the documentation says that you must run pg_basebackup on
> your old m
On Aug 5, 2012, at 11:12 AM, Fujii Masao wrote:
> On Sat, Jul 28, 2012 at 2:00 AM, Ben Chobot wrote:
>> We make heavy use of streaming replication on PG 9.1 and it's been great for
>> us. We do have one issue with it, though, and that's when we switch master
>> nodes - currently, the documentati
Mike Christensen writes:
> 1) Is it possible to make int2 + int2 = int4?
We could do that, but why stop there? int4 + int4 can overflow, maybe
its result should be int8? int8 + int8 can overflow, maybe its result
should be numeric? numeric + numeric can overflow, now what? And what
about subt
On Sun, Aug 5, 2012 at 1:21 PM, Tom Lane wrote:
> Mike Christensen writes:
>> 1) Is it possible to make int2 + int2 = int4?
>
> We could do that, but why stop there? int4 + int4 can overflow, maybe
> its result should be int8? int8 + int8 can overflow, maybe its result
> should be numeric? num
Hi,
I know that for condition like ((field1>value1) or (field1=value1 and
field2>value2)) I could built index on (field1, field2) and use indexable
condition like (field1, field2) > (value1, value2).
However, I have very tricky query which requires an indexable condition
like (field1>value1