Re: Non-Overlaping date interval index

From: Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Non-Overlaping date interval index
Date: 2006-02-18 18:38:52
Message-ID: 20060218183852.GA9837@KanotixBox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

A. Kretschmer <andreas(dot)kretschmer(at)schollglas(dot)com> schrieb:

> am 18.02.2006, um 10:03:11 +0100 mailte Pailloncy Jean-Gerard folgendes:
> > Hi,
> >
> > I wonder how to have a sort of "uniq" index on date interval, such that
> > there is no date interval overlaping in the table.
> >
> > exemple:
> > create table test (start timestamp, end timestamp);
> > with the constraint: end > start
>
> You can write a trigger to check the count of records which overlaps
> (start,end):

Sorry, there are a problem:

the trigger can't see uncommitted inserts from concurrent transactions.

Thanks to AndrewSN for this hint.

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknow)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-02-18 18:40:09 Re: Mixing different LC_COLLATE and database encodings
Previous Message Andrew - Supernews 2006-02-18 18:29:08 Re: Non-Overlaping date interval index