Issue
Postgresql maintain a internal value which is the max value of the id column of a given table. And uses this to generate values for primary keys when you insert new records. Sometimes this internally stored value can get messed up. And that can cause the error above when you are trying to insert a new record to the table.
How to fix ????
You need to basically correct the above said value.
Access to your database and run :
1
|
|
Change your rails app and run :
1 2 |
|
Update your_table_id_sql
1
|
|
replace your_table with whatever the table name you are using. And the code above assumes your primary key column name is id.
Good lucks to you :)