Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # After an import of data sometimes when you try to create new records, postgres creates same ids and cause clashes from time to time
- # To correct the sequence and tell postgres where to start counting next run this
- SELECT pg_catalog.setval(pg_get_serial_sequence('table_name', 'id'), MAX(id)) FROM table_name; # replace table_name with required table
Add Comment
Please, Sign In to add comment