Re: exclusion constraint with overlapping timestamps - Mailing list pgsql-general

From Jeff Davis
Subject Re: exclusion constraint with overlapping timestamps
Date
Msg-id 1283982521.25127.2.camel@jdavis-ux.asterdata.local
Whole thread Raw
In response to exclusion constraint with overlapping timestamps  ("A.M." <agentm@themactionfaction.com>)
List pgsql-general
On Wed, 2010-09-08 at 15:48 -0400, A.M. wrote:
> I am experimenting with exclusion constraints via Depesz's excellent
> introduction here:
> http://www.depesz.com/index.php/2010/01/03/waiting-for-8-5-exclusion-constraints/
>
> In the example, he uses non-overlapping (day) dates for hotel booking.
> In my case, I would like to use the same datatype but allow for
> timestamps to overlap on the boundaries, so that I can store a
> continuous timeline of state.
>

Consider using the PERIOD datatype instead:

     http://pgfoundry.org/projects/temporal

See an example here:

     http://thoughts.j-davis.com/2009/11/08/temporal-keys-part-2/

Regards,
    Jeff Davis


pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: error while autovacuuming
Next
From: Sam Nelson
Date:
Subject: Re: Memory Errors