Re: "two time periods with only an endpoint in common do not overlap" ???

Поиск
Список
Период
Сортировка
От Bryn Llewellyn
Тема Re: "two time periods with only an endpoint in common do not overlap" ???
Дата
Msg-id F95B7D83-4443-4E3C-A106-3171AB0DF1C2@yugabyte.com
обсуждение исходный текст
Ответ на Re: "two time periods with only an endpoint in common do not overlap" ???  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
David Johnston wrote:

Bryn wrote:

This means for instance that two time periods with only an endpoint in common do not overlap.

A range has two endpoints. The one at the later (end) of the range and the one at the earlier (start).  I suppose rewording it to say “boundary point” in common would avoid the ambiguity in the use of the word “end”.

Thanks, David. And thanks, too, to Tom and to Adrian for your prompt replies.

I see that I should have expressed myself more clearly. I never thought that either of the examples that I showed was behaving wrongly. David guessed right: I thought that the wording in the doc was confusing and might be improved.

A period (unless it collapses to an instant) is defined by the two moment values that bound it. (I’m using “moment” to mean a point in absolute time in a way that doesn’t care about the data type.) And when these two moments are distinct, one will be earlier than the other.

In plain English, people talk about, say, a relationship starting and (at least as often happens) ending. You ask “when did the relationship start and end?” Nobody talks about a relationship’s two endpoints. (But maybe they do in a different culture with a different language).

In fact, the PG doc reflects this vernacular usage by giving the signature of one of the overloads thus:

(start1, end1) OVERLAPS (start2, end2)

So I read “endpoint” in the doc I quoted to mean “either end1 or end2” (and, by extension, “startpoint”, if it had been used, to mean “either start1 or start2”.

But the doc wants me to take “endpoint” to mean “either start1, end1, start2, or end2”.

Maybe you think that I’m being too fussy. If so, please forgive me.

Certainly, David’s suggestion to use “boundary point” would be easy to implement, and would be an improvement. I think that I prefer this:

When the end of one period coincides with the start of the other period, then “overlaps” returns “false”. 

because it uses the terms in the same way that they are used in the signature.

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: "two time periods with only an endpoint in common do not overlap" ???
Следующее
От: Ben Madin
Дата:
Сообщение: Re: Postresql/postgis/qgis : assign privileges only for access/reading tables ?