Skip site navigation (1) Skip section navigation (2)

Re: Issues with generate_series using integer boundaries

From: Thom Brown <thom(at)linux(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PGSQL Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Issues with generate_series using integer boundaries
Date: 2011-02-01 00:48:13
Message-ID: AANLkTik8yiz+85dii0v6ErZgjw8V7DfmXnL2Uj=vKcGj@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
On 1 February 2011 00:41, Thom Brown <thom(at)linux(dot)com> wrote:
> On 1 February 2011 00:36, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> Thom Brown <thom(at)linux(dot)com> writes:
>>> Actually, those lower bound errors aren't related to generate_series,
>>> but I'd still like to know why -2147483648::int4 is out of range.
>>
>> :: binds tighter than - (and everything else too).  Write
>> (-2147483648)::int4 instead.
>
> D'oh.  You explained this to me before.  This time I'll endeavour to
> remember it.  At least that explains the problem I created for myself
> with lower boundaries.

Okay, so lower boundaries are still affected in the same way as upper
boundaries after all, at least when using a reverse series:

SELECT x FROM generate_series((-2147483644)::int4,
(-2147483648)::int4, -1) AS a(x);

-- 
Thom Brown
Twitter: @darkixion
IRC (freenode): dark_ixion
Registered Linux user: #516935

In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2011-02-01 01:05:25
Subject: Re: Issues with generate_series using integer boundaries
Previous:From: Thom BrownDate: 2011-02-01 00:41:25
Subject: Re: Issues with generate_series using integer boundaries

pgsql-general by date

Next:From: Aleksey TsalolikhinDate: 2011-02-01 00:54:38
Subject: Why does my DB size differ between Production and DR? (Postgres 8.4)
Previous:From: Thom BrownDate: 2011-02-01 00:41:25
Subject: Re: Issues with generate_series using integer boundaries

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group