Welcome to Post Facto

Post Facto is an open source Version Control System (VCS) for PostgreSQL. Unlike traditional version-control software which tracks changes between files, Post Facto tracks changes between databases. The deltas are stored as .sql files, much like the result of pg_dump. When you run postfacto checkout dbname, you don't receive files, you receive a new database.

Post Facto tracks schema changes only, not data, although it works hard to protect existing data. It is designed primarily to facilitate parallel application development by multiple workers or teams. It's especially useful for development, QA, continuous test (buildbot), and staging environments which need to switch between varying versions often. Post Facto also helps alleviate the pain of DB "hotfixes" in production (which never seem to make it back to dev).

If you've already got a "master" database and want to start tracking its changes, import your production copy as trunk@HEAD, then tag it as tags/master-1.0 (or whatever version number you choose to start with). Developers can then checkout trunk@HEAD, make changes for new features or to fix bugs in their local working copy, then commit their changes to trunk. They can also make branches as needed for collaboration or QA, and merge those changes back into trunk once approved. When everything is ready, upgrade your production server to trunk@HEAD (or a new tag as you see fit).

So:

$ pf import -U postgres --force <dbname> postfacto://me@server/repodb/myproject/trunk
Committed revision 1.

$ pf add -U postgres pmx_test "*"
Added 556 objects:
  constraints: cache.jobs, cache.runs, public.accounts,
  <lots more lines>

$ pf commit -m "Existing schema." <dbname>
Committed revision 2.

Read the documentation for the most-recent version (once it's uploaded!).

How To Get Post Facto

Try the Subversion repository at http://svn.post-facto.org/postfacto.

You can also find source and binary distributions (once we release something ;) at http://www.post-facto.org/chrome/common/releases/.

$ svn co http://svn.post-facto.org/postfacto/trunk/
...
Checked out revision 34.
$ cd trunk
$ python setup.py install
...
copying build/scripts-2.5/pf.py -> /home/fumanchu/envs/pf/bin changing mode of /home/fumanchu/envs/pf/bin/pf.py to 755 ...

Then, make a symlink from /usr/bin/pf to your new "pf.py" file (you can see where mine got copied to above; yours will differ). pf should then give you help output:

$ pf
Usage: pf [options] command *args

Options:
  -h, --help            show this help message and exit
...

Community and Contact

The "community" is quite small right now. If you have questions about using Post Facto, start with the #postgres IRC channel and talk to fumanchu. Feature requests should be done via tickets. You can also email me, Robert Brewer, personally at the address at the top of the page.

Versions

BranchStatus What's New Upgrading Browse Source
1.0 alpha source:postfacto/trunk