fixes #292 - adds postgres tests and fixes postgres issues
Merge pull request #367 from bshaffer/add-postgres

fixes #292 - adds postgres tests and fixes postgres issues