fixes to pgsql driver
bug fixes