I have a table with over million rows. I need to reset sequence and reassign id column with new values (1, 2, 3, 4... etc...). Is any easy way to do that?
FYI: If you need to specify a new startvalue between a range of IDs (256 - 10000000 for example):
SELECT setval('"Sequence_Name"', (SELECT coalesce(MAX("ID"),255) FROM "Table_Name" WHERE "ID" < 10000000 and "ID" >= 256)+1 );