Exclude constraint on ranges : commutative containment : allow onlycomplete containment
От
Achilleas Mantzios
Тема
Exclude constraint on ranges : commutative containment : allow onlycomplete containment
Дата
Msg-id
3b555944-1563-6614-a5d5-e0cc001aecdb@matrix.gatewaynet.com
Список
Дерево обсуждения
Exclude constraint on ranges : commutative containment : allow onlycomplete containment Achilleas Mantzios <achill@matrix.gatewaynet.com>
Re: Exclude constraint on ranges : commutative containment : allowonly complete containment Adrian Klaver <adrian.klaver@aklaver.com>
Re: Exclude constraint on ranges : commutative containment : allowonly complete containment Michael Lewis <mlewis@entrata.com>
Re: Exclude constraint on ranges : commutative containment : allowonly complete containment Achilleas Mantzios <achill@matrix.gatewaynet.com>
Re: Exclude constraint on ranges : commutative containment : allowonly complete containment Achilleas Mantzios <achill@matrix.gatewaynet.com>
Re: Exclude constraint on ranges : commutative containment : allowonly complete containment Adrian Klaver <adrian.klaver@aklaver.com>
Re: Exclude constraint on ranges : commutative containment : allowonly complete containment Achilleas Mantzios <achill@matrix.gatewaynet.com>
Re: Exclude constraint on ranges : commutative containment : allowonly complete containment Adrian Klaver <adrian.klaver@aklaver.com>
Hello Dear Postgresql ppl,
I have a table with date ranges and need to express the following constraint : allow overlaps only if there is complete containment, e.g.
allow values in rows like :
[2020-01-01,2020-01-31)
[2020-01-02,2020-01-10)
[2020-01-10,2020-01-20)
but disallow rows like
[2020-01-02,2020-01-10)
[2020-01-08,2020-01-11)
I think that writing a new commutative range operator e.g.
I have a table with date ranges and need to express the following constraint : allow overlaps only if there is complete containment, e.g.
allow values in rows like :
[2020-01-01,2020-01-31)
[2020-01-02,2020-01-10)
[2020-01-10,2020-01-20)
but disallow rows like
[2020-01-02,2020-01-10)
[2020-01-08,2020-01-11)
I think that writing a new commutative range operator e.g.
<@@> which would return true if the left operand is either contained by or contains the right operand and false otherwise would solve this, I am just wondering if there is a more elegant and economical way to express this. (besides writing a trigger which is always an option).-- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt
В списке pgsql-general по дате отправления