Re: Exclusion constraint issue

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Eric McKeeth <eldin00(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Exclusion constraint issue
Date: 2010-09-28 22:07:00
Message-ID: 1285711620.19812.7.camel@jdavis-ux.asterdata.local
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2010-09-28 at 12:18 -0600, Eric McKeeth wrote:

> This is ugly, but it does seem to enforce the constraint I need, of
> non-overlapping dates where sharing an endpoint is not considered an
> overlap.

The period type supports different inclusivity/exclusivity combinations.
So, the period:

'[2009-01-02, 2009-01-03)'

Does not overlap with:

'[2009-01-03, 2009-01-04)'

Because "[" or "]" means "inclusive" and "(" or ")" means "exclusive".

For further discussion, you can join the temporal-general(at)pgfoundry(dot)org
mailing list (sign up at
http://pgfoundry.org/mailman/listinfo/temporal-general ). If this still
does not solve your use case, I'd like to see if it can be modified to
do so.

Regards,
Jeff Davis

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bartlomiej Korupczynski 2010-09-28 22:16:28 Re: UPDATE/DELETE with ORDER BY and LIMIT
Previous Message Tom Lane 2010-09-28 21:51:57 Re: Behavior of parameter holders in query containing a '$1'