SELECT setval('table_id_seq', (SELECT MAX(id) FROM table));
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)+1);