Search Postgresql Archives

Re: feature idea – automatic up

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
   (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux