Re: Fix overflow in justify_interval related functions - Mailing list pgsql-hackers

From Joseph Koshakow
Subject Re: Fix overflow in justify_interval related functions
Date
Msg-id CAAvxfHfaR8En08jB5sp7w-n1tv9HrBaz0wiKGRMbG1mo25yvVw@mail.gmail.com
Whole thread Raw
In response to Re: Fix overflow in justify_interval related functions  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: Fix overflow in justify_interval related functions  (Nathan Bossart <nathandbossart@gmail.com>)
List pgsql-hackers
On Mon, Feb 14, 2022 at 2:15 PM Nathan Bossart <nathandbossart@gmail.com> wrote:
> Makes sense.  So we could likely avoid it for justify_interval, but the
> others are at the mercy of the interval implementation.

I'm not entirely sure what you mean by "it", but for both
justify_interval and justify_days this commit throws an error if we
try to set the months field above 2^31.

> +SELECT justify_days(interval '2147483647 months 30 days');
> +ERROR:  interval out of range
> +SELECT justify_interval(interval '2147483647 months 30 days');
> +ERROR:  interval out of range

That's what these are testing.

- Joe Koshakow



pgsql-hackers by date:

Previous
From: Nikolay Samokhvalov
Date:
Subject: Re: Observability in Postgres
Next
From: Peter Eisentraut
Date:
Subject: Re: fixing bookindex.html bloat