Is there any ready mechanism in Oracle, SQL Server, PostgreSql or OR framework (C#), which can version information in a database? By versioning informartion I mean that e.g. I have table Person
(id, version, isEnable, enableFrom, enableTo, name, surname
), and any change in column name or surname makes new row with incremented version, changed isEnable
, enableFrom
and enableTo
.
|
|||||||||||||||||
|
closed as not a real question by Jon Seigel, Mark Storey-Smith, Phil, Jack Douglas♦ Mar 4 at 9:42
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.
Audit triggers are often sufficient for this, eg: http://wiki.postgresql.org/wiki/Audit_trigger_91plus ... or follow Neil McGuigan's suggestion of using time range fields to simulate a temporal database using a normal RDBMS. What you describe sounds simple at first, but then consider the following sequence of events, using the imaginary
How do you handle this when you're doing time-travel like auditing? The table no longer has the This is why I chose to use a As for versioning, that's harder than you think too. How does the database efficiently get the "latest" version? PostgreSQL actually used to do something like this back in the 6.x days with a feature called Time Travel, which (AFAIK) used the MVCC mechanism to keep old row versions and allow you to query them. It caused all sorts of performance and maintenance problems and was removed in late 6.x / early 7.x period (haven't checked exactly when). |
|||
|
sounds like you're looking for a temporal database generally, it's as simple as adding a from_date and to_date (nullable) columns example:
For a Person, you might have born_at and died_at columns Postgres has a temporal extension for some extra validation for this kinda thing |
||||
|