BUG #6290: converting interval from weeks to days

Started by Alexey A. Nalbatover 14 years ago3 messagesbugs
Jump to latest
#1Alexey A. Nalbat
alexey_nalbat@hotbox.ru

The following bug has been logged online:

Bug reference: 6290
Logged by: Alexey Nalbat
Email address: alexey_nalbat@hotbox.ru
PostgreSQL version: 9.1.1
Operating system: Ubuntu
Description: converting interval from weeks to days
Details:

=> select '1000000000 weeks'::interval;
interval
------------------
-1589934592 days
(1 row)

#2John R Pierce
pierce@hogranch.com
In reply to: Alexey A. Nalbat (#1)
Re: BUG #6290: converting interval from weeks to days

On 11/10/11 1:15 PM, Alexey Nalbat wrote:

=> select '1000000000 weeks'::interval;
interval
------------------
-1589934592 days

a billion weeks is like 19 million years. somehow, I don't think that
postgresql's date math has quite that range.

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

#3Craig Ringer
craig@2ndquadrant.com
In reply to: John R Pierce (#2)
Re: BUG #6290: converting interval from weeks to days

On 11/11/2011 09:35 AM, John R Pierce wrote:

On 11/10/11 1:15 PM, Alexey Nalbat wrote:

=> select '1000000000 weeks'::interval;
interval
------------------
-1589934592 days

a billion weeks is like 19 million years. somehow, I don't think that
postgresql's date math has quite that range.

It should probably detect overflow and fail with an error like Pg does
with other overflow conditions, though. I think that was probably the point.

--
Craig Ringer