Check postgresql status code