ALTER TABLE temp ALTER COLUMN id ADD GENERATED BY DEFAULT AS IDENTITY
TRUNCATE TABLE someTable RESTART IDENTITY;
SELECT setval('test_id_seq', (SELECT MAX(id) from "test"));