Returning error if insert fails using pg driver