Postgresql reset sequence

postgresql
SELECT
	setval(pg_get_serial_sequence('tbl', 'id'), COALESCE(max(id) + 1, 1), FALSE)
FROM
	tbl;