Fix postgresql connection