add some postgres checks