Re: = t1 - t0 but t0 + i <> t1 when t1 and t2 timestamptz values and i is an interval value

From: Bryn Llewellyn <bryn(at)yugabyte(dot)com>
To: Francisco Olarte <folarte(at)peoplecall(dot)com>
Cc: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: = t1 - t0 but t0 + i <> t1 when t1 and t2 timestamptz values and i is an interval value
Date: 2021-03-29 21:48:40
Message-ID: 7CCA5681-341E-440B-BD94-3EA8DB003C5A@yugabyte.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On 27-Mar-2021, at 01:42, Francisco Olarte <folarte(at)peoplecall(dot)com> wrote:
>
> Bryn, ( 1st, sorry if I misquote something, but i use text-only for the list )...

Thanks again, Francisco. You said several things that clarify my understanding. Re your comment:

> I've never tried to make some thing as complex as what you seem to be trying…

What I’m trying to do is to understand interval semantics so that I can write a clear account of this topic. I do find the PostgreSQL doc on the topic difficult to use for this purpose because information is scattered and (as you said) it’s a dense read. This is why (though I don’t like the approach) I’m amassing empirical observations and trying to fit a mental model to what I observe.

Re your comment:

> I'm completely lost with the horological/cultural things…

My claim is that there’s a genuine distinction to be drawn in the conceptual domain—and that this can be made independently of any particular computer system. I might say that “1 day” is simply the same thing as “24 hours”, in the same way that “1 foot” is the same as “12 inches”. But my discussion partner might argue with this saying that the length of one day is sometimes 23 hours and sometimes 25 hours due to the much-rehearsed arguments about DST. Here, I’d be thinking horologically and my discussion partner would be thinking culturally. Those two terms of art (or other equivalent ones) are useful to stop a fist fight breaking out by allowing each discussion partner to understand, and label, the other’s mental model—both of which have merit.

Notice that the same argument could be had about the equivalence of “1 minute” and “60 seconds” in the light of the “leap second” phenomenon. It just happens that when we get to PostgreSQL, its Proleptic Gregorian Calendar implementation knows nothing of leap seconds. At least, this is how I interpret “because leap seconds are not handled” on the https://www.postgresql.org/docs/11/functions-datetime.html page.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Don Seiler 2021-03-29 22:00:34 Dangerous Naming Confusion
Previous Message Laurenz Albe 2021-03-29 17:12:15 Re: questions about wraparound