Fixes to the postgres framework