Almost finished PostgreSQL support. Fixed a minor Linux compilation issue.