Search Postgresql Archives

Re: Issues with generate_series using integer boundaries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 1 February 2011 01:05, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
> Thom Brown <thom@xxxxxxxxx> writes:
>> I've noticed that if I try to use generate_series to include the upper
>> boundary of int4, it never returns:
>
> I'll bet it's testing "currval > bound" without considering the
> possibility that incrementing currval caused an overflow wraparound.
> We fixed a similar problem years ago in plpgsql FOR-loops...

And here's another case:

SELECT x FROM generate_series(2147483643, 2147483644,5) AS a(x);

A step of 1 would work fine, but forcing it to exceed the boundary in
this way means it never returns.

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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux