How to reject overlapping timespans?

Поиск
Список
Период
Сортировка
От Andreas
Тема How to reject overlapping timespans?
Дата
Msg-id 51210D23.9070403@gmx.net
обсуждение исходный текст
Ответы Re: How to reject overlapping timespans?  (Andreas Kretschmer <andreas@a-kretschmer.de>)
Список pgsql-sql
Hi,

I need to store data that has a valid timespan with start and enddate.

objects ( id, name, ... )
object_data ( object_id referencs objects(id), startdate, enddate, ... )

nothing special, yet

How can I have PG reject a data record where the new start- or enddate 
lies between the start- or enddate of another record regarding the same 
object_id?

Also it isn't allowed that such timespans lie within another.

There can be times where no valid data exists but there can't be more 
than one valid data-record for the same point in time.




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

Предыдущее
От: Ben Morrow
Дата:
Сообщение: Re: Perform Function When The Rows Of A View Change
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: How to reject overlapping timespans?