Re: Summing of INTERVAL returns incorrect number of days and hours

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Milan Novotny <xnovm149(at)gmail(dot)com>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: Summing of INTERVAL returns incorrect number of days and hours
Date: 2025-04-01 14:19:36
Message-ID: 346945.1743517176@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Milan Novotny <xnovm149(at)gmail(dot)com> writes:
> 581 days 61:06:36.805|
> --> should be 583 days ..

If you don't like that result, justify_hours() might help you.
But interval summing doesn't assume that it can always overflow
seconds into days, because a day isn't always 24 hours.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2025-04-01 14:34:30 BUG #18874: CVE-2024-4317
Previous Message Milan Novotny 2025-04-01 13:13:08 Summing of INTERVAL returns incorrect number of days and hours