This has become a Ruby gem: https://github.com/ifad/chronomodel
A temporal database system on PostgreSQL using table inheritance and the rule system.
This is a data structure for a Slowly-Changing Dimension Type 2 temporal database, implemented using only PostgreSQL >= 9.0 features.
Any application code is completely unaware of the temporal features: queries are done against a view that behaves exactly like a plain table (it can be SELECTed, UPDATEd, INSERTed INTO and DELETEd FROM), but behind the scenes the database redirects the queries to backend tables holding actual data, using the PostgreSQL rule system.