Re: Data version idea (please discuss)
От | Mike Mascari |
---|---|
Тема | Re: Data version idea (please discuss) |
Дата | |
Msg-id | 41138448.30201@mascari.com обсуждение исходный текст |
Ответ на | Data version idea (please discuss) (webb <wwsprague@ucdavis.edu>) |
Список | 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
В списке pgsql-general по дате отправления: