Re: challenging constraint situation - how do I make it

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: challenging constraint situation - how do I make it
Дата
Msg-id 44744FFD.6010805@magproductions.nl
обсуждение исходный текст
Ответ на Re: challenging constraint situation - how do I make it  (Kenneth Downs <ken@secdat.com>)
Ответы Re: challenging constraint situation - how do I make it  (Kenneth Downs <ken@secdat.com>)
Re: challenging constraint situation - how do I make it  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Kenneth Downs wrote:
> Alban Hertroys wrote:
>
>> When encountering this problem I usually wonder why there isn't a data
>> type that can store a timestamp and can be used to create a UNIQUE
>> INDEX over it's values. That'd be wonderful.
>> Well, maybe one day I'll actually have time to create one...
>>
> I tried this at trigger level.  The real bear is in the fact that there
> are two columns, not one.  It is trivial to write an exclusion
> constraint that disallows overlapping (including nested) values.  What
> was hard was determining the meta-data structure, how do you have two
> columns that are sometimes treated as one and sometimes as two?

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).

I've never really dug into this, so I don't know what possibilities
PostgreSQL offers in this field. Basing this on faith :)

Regards,
--
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

// Integrate Your World //

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

Предыдущее
От: Kenneth Downs
Дата:
Сообщение: Re: background triggers?
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Clearing out old idle connections