Re: WIP: generalized index constraints

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: WIP: generalized index constraints
Дата
Msg-id 407d949e0907060902q5f88e087k73a88d611837edbe@mail.gmail.com
обсуждение исходный текст
Ответ на Re: WIP: generalized index constraints  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: WIP: generalized index constraints  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
On Mon, Jul 6, 2009 at 4:57 PM, Jeff Davis<pgsql@j-davis.com> wrote:
>
> Exactly, you already know my use case ;) My goal is a "temporal key",
> where you can't have overlapping intervals of time, e.g. the constraint
> "nobody can be two places at the same time".

Incidentally to handle non-overlapping ranges you don't need GIST, you
can actually use a plain btree. Since there are no overlapping ranges
the ranges have a complete ordering and you can get that by just
sorting by either endpoint. To enforce the constraint you only have to
compare with the previous and following element in the btree.

-- 
greg
http://mit.edu/~gsstark/resume.pdf


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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: WIP: generalized index constraints
Следующее
От: Jaime Casanova
Дата:
Сообщение: TODO items: Alter view add column