Re: Exclusion constraint issue

From: Eric McKeeth <eldin00(at)gmail(dot)com>
To: Jeff Davis <pgsql(at)j-davis(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Exclusion constraint issue
Date: 2010-09-28 23:17:09
Message-ID: AANLkTimZj+Hp8oZmG5WHOOWhtB-YoRE68fi+8Lhe4HyD@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 28, 2010 at 4:07 PM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:

> 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".
>

My problem wasn't with getting the period type to represent overlaps with
the correct inclusivity/exclusivity, but in getting it to work with my
exclusion constraint. Can you show an example of how I could get that
working perhaps?

> 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
>
>
I've subscribed to the temporal-general list, so we can move this discussion
there if that's more appropriate.

Thanks,
Eric

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2010-09-28 23:25:30 Re: How to handle results with column names clash
Previous Message Brian Hirt 2010-09-28 23:11:46 Re: pg_upgrade