postgres reset sequence after import
Sometimes you get error after importing pg_dump data caused by constrain error
This can be caused by sequence that is not updated. Some symptoms include that if you retry multiple time, it works. That is due to every error increments the sequence.
To reset the value to the last id: (replace the table_name
with your table)
Last updated