Robby Russell wrote in post #72333:
SELECT MAX(id) FROM entities;
Then run...
This should be higher than the last result.
If it's not higher... run this to try and fix it. (run a quick
pg_dump first...)
SELECT setval('entities_id_seq', (SELECT MAX(id) FROM entities)+1);
reload your app...and see if its still happening.
I have the same problem but I don't know how to solve it since I can't
relate the solution here (names of tables, etc.) to the data given by
the OP. How do you know you need to SELECT MAX(id) FROM entities, or
SELECT setval('entities_id_seq', (SELECT MAX(id) FROM entities)+1);
with the information given by the OP? I can't see the relation and
therefore I have no clue how I can solve my problem.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Nurlan A. at Jan 2, 2012 at 7:00 am

    Robby Russell wrote in post #72333:
    On Apr 29, 2006, at 5:56 PM, Guido Sohne wrote: ...
    SELECT MAX(id) FROM entities;
    SELECT nextval('entities_id_seq');
    This should be higher than the last result.
    SELECT setval('entities_id_seq', (SELECT MAX(id) FROM entities)+1);
    ...

    Thank you so much fro this post!

    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 1, '11 at 2:26a
activeJan 2, '12 at 7:00a
posts2
users1
websiterubyonrails.org
irc#RubyOnRails

1 user in discussion

Nurlan A.: 2 posts

People

Translate

site design / logo © 2022 Grokbase