Re: Fix overflow in justify_interval related functions

From: Nathan Bossart <nathandbossart(at)gmail(dot)com>
To: Joseph Koshakow <koshy44(at)gmail(dot)com>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Fix overflow in justify_interval related functions
Date: 2022-02-14 18:35:40
Message-ID: 20220214183540.GA2000855@nathanxps13
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Feb 13, 2022 at 01:28:38PM -0500, Joseph Koshakow wrote:
> +SELECT justify_hours(interval '2147483647 days 24 hrs');
> +ERROR: interval out of range

The docs [0] claim that the maximum value for interval is 178 million
years, but this test case is only ~6 million. Should we instead rework the
logic to avoid overflow for this case?

[0] https://www.postgresql.org/docs/devel/datatype-datetime.html

--
Nathan Bossart
Amazon Web Services: https://aws.amazon.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Christoph Berg 2022-02-14 18:49:59 Re: Non-decimal integer literals
Previous Message Robert Haas 2022-02-14 18:12:49 Re: Mark all GUC variable as PGDLLIMPORT