Re: exclusion constraint with overlapping timestamps

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: "A(dot)M(dot)" <agentm(at)themactionfaction(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: exclusion constraint with overlapping timestamps
Date: 2010-09-08 21:48:41
Message-ID: 1283982521.25127.2.camel@jdavis-ux.asterdata.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sam Nelson 2010-09-08 22:55:33 Re: Memory Errors
Previous Message Alvaro Herrera 2010-09-08 21:33:47 Re: error while autovacuuming