Test postgresql connection