Re: computing dT from an interval

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Michael J(dot) Baars" <mjbaars1977(dot)pgsql-hackers(at)cyberfiber(dot)eu>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: computing dT from an interval
Date: 2021-02-22 15:52:42
Message-ID: 3584074.1614009162@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Michael J. Baars" <mjbaars1977(dot)pgsql-hackers(at)cyberfiber(dot)eu> writes:
> So how do you compute the number of seconds in 8 years?

IMO, that's a meaningless computation, because the answer is not fixed.
Before you claim otherwise, think about the every-four-hundred-years
leap year exception in the Gregorian rules. Besides, what if the
question is "how many seconds in 7 years"? Then it definitely varies
depending on the number of leap days included.

What does make sense is timestamp subtraction, where the actual
endpoints of the interval are known.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2021-02-22 15:56:42 Re: {CREATE INDEX, REINDEX} CONCURRENTLY improvements
Previous Message Tom Lane 2021-02-22 15:45:21 Re: do coverage test without install lcov