Fixes to pgsql driver and manager