delicious

Fixing Sequences - PostgreSQL wiki

A murb'ed feed, posted more than 11 years ago filed in query, fix, PostgreSQL & postgres.

A common problem when copying or recreating a database is that database sequences are not updated just by inserting records in the table that sequence is used in. If you want to make your sequences all start just after whatever values are already there, it’s possible to do that for most common configurations like this…

Go to the original link.