select
    case
        when y.next_sequence > x.max_id 
        then 'Success. Claim sequence reset correctly.'
        else 
            'Fail. Max claim.id = ' || 
            x.max_id || 
            ', next sequence = ' || 
            next_sequence || '.'
    end as test_result
from
    (select max(id) as max_id from claim) x,
    (select nextval('claim_id_seq') as next_sequence) y;