Fix some more postgres problems