Added compatibility for postgresql