Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Postgres auto-increment key errors on Rails 3 #15

Closed
luckie-pair opened this issue Dec 6, 2010 · 3 comments
Closed

Postgres auto-increment key errors on Rails 3 #15

luckie-pair opened this issue Dec 6, 2010 · 3 comments

Comments

@luckie-pair
Copy link

Rails 3.0.3
pg adapter 0.10.0
Postgres 9.0.1

It appears that using populator on a model in my app breaks the sequencing on the table. When I go to save another instance of that model through my app, I get errors along the lines of:

PGError: ERROR: duplicate key value violates unique constraint "entries_pkey"
DETAIL: Key (id)=(12) already exists.

@ryanb
Copy link
Owner

ryanb commented Jan 18, 2011

I believe this was fixed by this commit but that never made it into the gem release. I'll be releasing a new version soon for Rails 3 support. Closing this, but please comment here if the next release doesn't resolve this issue.

@traviskroberts
Copy link

Did this ever make it into a gem release? I'm running into the same problem, but this issue was closed more than a year ago.

EDIT: Instead of getting an error populating the database, it appears that the auto_increment isn't getting reset on subsequent runs. Here's an example: https://gist.github.com/1718737

@luckie-pair
Copy link
Author

The 1.0.0 release corrected this for me. No problems here.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants