I want to restart sequence with max+1 of certain table.
SELECT max(id)+1
INTO testVal
FROM project;
ALTER SEQUENCE project_id_seq RESTART testVal;
This gives syntax error at testVal. Can someone please explain me what is a problem, propose alternative solution?