Re: Data version idea (please discuss)

From: Mike Mascari <mascarm(at)mascari(dot)com>
To: Michael Glaesemann <grzm(at)myrealbox(dot)com>
Cc: Richard Huxton <dev(at)archonet(dot)com>, webb <wwsprague(at)ucdavis(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: Data version idea (please discuss)
Date: 2004-08-06 13:14:48
Message-ID: 41138448.30201@mascari.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Glaesemann wrote:

> Thanks for the links! I remember coming across a TimeCenter paper. The
> TimeCenter reference page is quite extensive and I look forward to
> reading more of the work Darwen and Date critiqued.

Sorry for the redundant Darwen critique link.

>
> On Aug 6, 2004, at 6:37 PM, Mike Mascari wrote:
>
>> Partial indexes get me close to where I want with temporal features. I
>> just wish the RI constraints had the ability to supply a WHERE clause.
>> Between the two, it might get me were I want, rather than having to
>> write triggers to ensure temporal integrity.
>
>
> Would you mind going into more depth into how you're doing this?

It's rather crude. I've a start and end date on all temporal
relations. I've a surrogate key as well. The uniqueness of the
actual candidate key is enforced by a partial index only over tuples
whose end date IS NULL. I maintain "temporal integrity" through ON
UPDATE triggers. When a temporal tuple is deactivated, all relations
that have the soon-to-be deactivated tuple's surrogate key are also
deactivated. I also have a corresponding view for each temporal
relation that is queried by non-reporting user interfaces. They see
the active tuples, while the reporting component queries the base
relations for the entire history.

However, this is all maintained by a series of spaghetti C-language
SPI routines, and my own home-brewed version of pg_constraint, as
opposed to nice declared referential integrity, for the obvious reasons.

Mike Mascari

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Markus Bertheau 2004-08-06 13:35:45 PostgreSQL 7.4.2 allows foreign key violation
Previous Message Marius Andreiana 2004-08-06 12:54:46 Re: Data version idea (please discuss)