Ustaw wartość sekwencji Postgres na maksymalny identyfikator

SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
Awful Angelfish