Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8118427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T04:29:11+00:00 2026-06-06T04:29:11+00:00

I migrated my db from Sqlite to Postgres. Now when I try to create

  • 0

I migrated my db from Sqlite to Postgres. Now when I try to create a new record

Account.create! code:"0001", name:"foo"

I got this error

ActiveRecord::RecordNotUnique: PG::Error: ERROR: duplicate key value violates unique constraint "accounts_pkey"
DETAIL: Key (id)=(4) already exists.

It seems like the autoincrement is not working. Do I need some extra configuration???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T04:29:13+00:00Added an answer on June 6, 2026 at 4:29 am

    You can change the sequence value of your PG table manually using pgAdminIII.
    Go to your Database -> Sequences, click on your table correspondent to your model and change it’s Current value.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently migrated from rails 2 to Rails 3 and thus got the new
I migrated from rails 2.x to 3.x. Now when calling a controller method throws
I just right now migrated from C# to C++/CLR. First I was annoyed, that
hello I'm new to PHP programming and I migrated from ASP .net to PHP..
I migrated from Java to C# and so I am wondering how to unit
Recently we migrated from VSS to SVN. But I don't want VSS removed totally,
My application is throwing this error after I have migrated from GWTP 0.6 to
At work, we have migrated from Windows XP to Windows Vista. After the migration,
We have a 3.5 Gb SVN repository recently migrated from a 6 Gb one.
I know this question is really open-ended. Recently migrated from one server to another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.