3 ms·
The most common cause of this is doing a data import, etc. and not setting the starting sequence number to be one higher than that table's current max(id) - som
by michaelbuckbee 15y ago
The most common cause of this is doing a data import, etc. and not setting the starting sequence number to be one higher than that table's current max(id) - something I found out after getting the same error with a MySQL to Postgres migration I'm working on.
The terminology is a little different with Postgres, but nearly every database has a way of setting what you'd like the initial value of the autoincrementing id field to be.