pg_query wrapper to recovery if it fails