Merge pull request #981 from narfbg/develop-db-postgre

Improve the PostgreSQL database driver