How to reject overlapping timespans? - Mailing list pgsql-sql

From Andreas
Subject How to reject overlapping timespans?
Date
Msg-id 51210D23.9070403@gmx.net
Whole thread Raw
Responses Re: How to reject overlapping timespans?
List 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 by date:

Previous
From: Ben Morrow
Date:
Subject: Re: Perform Function When The Rows Of A View Change
Next
From: Andreas Kretschmer
Date:
Subject: Re: How to reject overlapping timespans?