Re: Add operator for dividing interval by an interval - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Add operator for dividing interval by an interval
Date
Msg-id 3894515.1684443804@sss.pgh.pa.us
Whole thread Raw
In response to Add operator for dividing interval by an interval  (Andres Freund <andres@anarazel.de>)
Responses Re: Add operator for dividing interval by an interval
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> What about an interval / interval -> double operator that errors out whenever
> month is non-zero? As far as I can tell that would always be deterministic.

We have months, days, and microseconds, and microseconds-per-day isn't
much more stable than days-per-month (because DST).  By the time you
restrict this to give deterministic results, I think it won't be
particularly useful.

You could arbitrarily define months as 30 days and days as 24 hours,
which is what some other interval functions do, and then the double
result would be well-defined; but how useful is it really?

            regards, tom lane



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: PG 16 draft release notes ready
Next
From: Przemysław Sztoch
Date:
Subject: Re: [PATCH] Support % wildcard in extension upgrade filenames