Re: unique index for periods

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: unique index for periods
Дата
Msg-id 407d949e0908200856n40379da9j1374203e82d06bed@mail.gmail.com
обсуждение исходный текст
Ответ на Re: unique index for periods  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: unique index for periods
Список pgsql-general
On Thu, Aug 20, 2009 at 3:14 PM, Tom Lane<tgl@sss.pgh.pa.us> wrote:
> I don't believe it is possible to use a btree index for this purpose,
> because there just isn't a way to express "overlaps" as a total order.

That's true for the general case of indexing ranges but I don't think
that's true for the case where overlaps are illegal. In such a case
you could just, sorting by the start point, compare the previous
entry's end point with your start point and the next entry with your
end point.

However that's not the way unique indexes work in Postgres so
supporting that would require a lot of new abstractions and code, not
just a new opclass.

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

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

Предыдущее
От: leif@crysberg.dk
Дата:
Сообщение: Connection name on ECPGdeallocate ?
Следующее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: Re: Generating random unique alphanumeric IDs