From: Tom Lane <tgl@sss.pgh.pa.us>
To: Milan Novotny <xnovm149@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: Summing of INTERVAL returns incorrect number of days and hours
Date: Tue, 01 Apr 2025 10:19:36 -0400
Message-ID: <346945.1743517176@sss.pgh.pa.us> (raw)
In-Reply-To: <CACZpPHoN2wHXDushnJqJy3Aus-MzYq_V3WjB9KaU8ATjXdrQeg@mail.gmail.com>
References: <CACZpPHoN2wHXDushnJqJy3Aus-MzYq_V3WjB9KaU8ATjXdrQeg@mail.gmail.com>
Milan Novotny <xnovm149@gmail.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, xnovm149@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: Summing of INTERVAL returns incorrect number of days and hours
In-Reply-To: <346945.1743517176@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox