Re: [GENERAL] Is this a Postgres Bug?

2012-08-05 Thread Xiong He
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:

Re: [GENERAL] Is this a Postgres Bug?

2012-08-05 Thread Tomas Vondra
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:

Re: [GENERAL] Is this a Postgres Bug?

2012-08-05 Thread Mike Christensen
>> 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 >> >

Re: [GENERAL] can we avoid pg_basebackup on planned switches?

2012-08-05 Thread Fujii Masao
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

Re: [GENERAL] can we avoid pg_basebackup on planned switches?

2012-08-05 Thread Ben Chobot
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

Re: [GENERAL] Is this a Postgres Bug?

2012-08-05 Thread Tom Lane
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

Re: [GENERAL] Is this a Postgres Bug?

2012-08-05 Thread Mike Christensen
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

[GENERAL] Is it possible to create row-wise indexable condition for special case...

2012-08-05 Thread Maxim Boguk
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