Using the postgres db (or even the Access DB) for SQL queries from PokerTracker is useful for a lot of analysis, but you will not be able to reconstruct a hand action by action.
If you want to parse hand histories you can take a look at BisonBisons code for his handconverter (written in PERL) which he released into OpenSource at:
http://sourceforge.net/projects/handconverter
It is very specific to its function, and will take some tinkering to make it do whatever it is you want to do. But as long as that tinkering and eventual use complies with the GNU license he released it under, it's a good place to start.