Lecture: Tracking Reproducible Revisions in PostgreSQL with Psycopg2
Now you have your database model representing all objects and relations between them. How do you track changes and updates in order to be able to reproduce the status quo at any point in the history? And how do you write your admin tool in Python and psycopg2 in order to avoid concurrent updates and commit all updates within distinct revisions?
PostgreSQL 9.2 introduced the Ranges type that we're going to use to keep track of historical versions of our data. A small trick with transactions in psycopg2 will allow us to avoid concurrent modification of our database from two or more sources.