Re: gaps/overlaps in a time table : current and previous row question

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: thomas veymont <thomas(dot)veymont(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: gaps/overlaps in a time table : current and previous row question
Date: 2011-10-20 02:56:48
Message-ID: 1319079408.16256.45.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2011-10-05 at 15:35 +0200, thomas veymont wrote:
> hello,
>
> let's say that each rows in a table contains a start time and a end
> time ("timeinterval" type),
> but the index are not ordered nor consecutive, e.g :

I think your question has already been answered, but I thought you might
be interested in:

Period data type:
http://pgxn.org/dist/temporal/

Or Exclusion Constraints, which can prevent overlapping ranges:
http://www.postgresql.org/docs/current/static/sql-createtable.html#SQL-CREATETABLE-EXCLUDE

Also, I'm currently working on a feature called Range Types, which will
hopefully be in 9.2.

Regards,
Jeff Davis

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2011-10-20 03:12:29 Re: Need Help : PostgreSQL Installation on Windows 7 64 bit
Previous Message Jeff Davis 2011-10-20 02:20:15 Re: inserting bytea using PHPs pg_escape_bytea()