Re: challenging constraint situation - how do I make it

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: challenging constraint situation - how do I make it
Дата
Msg-id 558.1148496858@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: challenging constraint situation - how do I make it  (Alban Hertroys <alban@magproductions.nl>)
Ответы Vector type (Re: challenging constraint situation - how do I make it)  (Alban Hertroys <alban@magproductions.nl>)
Список pgsql-general
Alban Hertroys <alban@magproductions.nl> writes:
> Are you refering to a 'timespan' data type that can be determined to be
> unique?

> I can see some problems there, as both value and range matter; it'd be
> similar to determining the uniqueness of an area in a rectangle (though
> 1 dimensional only, of course).

Except that what you want is to forbid overlap, not forbid equality.
This is not possible with btree-based unique indexes, because btree
will not like an opclass whose "equality" member is not transitive.

If you look in the archives you'll find previous discussion of this
point, including some blue-sky speculation about whether GiST indexes
could be made to serve the purpose.  That's a long way from being a
solution you could use today, though.

            regards, tom lane

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

Предыдущее
От: Jorge Godoy
Дата:
Сообщение: Re: [SQL] (Ab)Using schemas and inheritance
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Clearing out old idle connections