\set script_file `date +%Y%m%d%H%M%S` .sql
\t
\o :script_file
select
    'alter sequence claim_id_seq restart ' || max(id) + 1 || ';'
from
    claim;
\o
\t
\i :script_file
