I am using Hibernate 3.3 and PostgreSQL 8.x and would like to use Hibernate annotations to map an auto-incremented column which is NOT a primary key.
It doesn\'t ma
Database sequence is not sync with your private key. So you need to update sequence index.
Check your sequence id from db and execute this sql command. (Do not forget to get backup your db just in case)
SELECT setval('your_primary_key_sequence', (SELECT MAX(your_primary_key) FROM your_table)+1);