Re: New entry tries to use an existing unique id

2018-10-26 Thread Michel Lavoie
All good now, thanks again. I ended up using this one-liner to do what you described: SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); Found here: https://gist.github.com/henriquemenezes/962829815e8e7875f5f4376133b2f209 Michel On Friday, October 26, 2018 at 7:10:53 AM UTC-4, Michel

Re: New entry tries to use an existing unique id

2018-10-26 Thread Michel Lavoie
Wow thank you Sanjay, this is beyond helpful! I'll try the steps you suggested; I need the ids to remain the same. Michel On Friday, October 26, 2018 at 6:25:09 AM UTC-4, Sanjay Bhangar wrote: > > Hi Michel, > > So, a little explanation of why you're facing this issue: > > When you create an "au

Re: New entry tries to use an existing unique id

2018-10-26 Thread Sanjay Bhangar
Hi Michel, So, a little explanation of why you're facing this issue: When you create an "auto-increment" field in Postgres, Postgres creates something called a "sequence" to keep track of the increments. If you were to `psql` into your database and check the schema of the table, you'll see the `i

New entry tries to use an existing unique id

2018-10-25 Thread Michel Lavoie
Hi, I migrated my previous sqlite3 installation to postgresql, following this discussion: https://groups.google.com/forum/#!msg/django-users/VGG8GTAX4l0/tQUW20HcAwAJ I'm not facing another weird issue: Whenever I try to create a new item (finance.models.Debtor, see https://github.com/miek770/