More postgresql fixes