Re: feature idea – automatic up
От | Richard Huxton |
---|---|
Тема | Re: feature idea – automatic up |
Дата | |
Msg-id | 40ADDE30.5080006@archonet.com обсуждение исходный текст |
Ответ на | feature idea automatic update tracking using date fields feedback pls (anony@dslextreme.com (anony)) |
Ответы |
Re: feature idea – automatic up
|
Список | pgsql-general |
anony wrote: > Maybe this feature is already out there. > I guess you could write triggers to do some of this. > > Often when designing a database I add a start_date and end_date column > to the table. The start_date is when the record was created and the > end_date is when the record expired. For UPDATES, I populate the > end_date and INSERT a new record. This allows you to track changes > though out time. You probably want to read up on "Temporal Databases" which is what you're talking about. I believe there is a book by C.J.Date on the topic as it relates to relational DBs. From a curiosity point of view, there apparently used to be a "time-travel" feature in (really) old versions of PG. MVCC effectively creates a new row for every update anyway, so you could "rewind" to previous transaction IDs to see the data then. -- Richard Huxton Archonet Ltd
В списке pgsql-general по дате отправления: