Re: duplicate key value violates unique constraint "django_admin_log_pkey"
Helped me too. Thanks. On Thursday, October 14, 2010 at 8:54:30 PM UTC+5:30, glob...@iamsandiego.com wrote: > > Hi Folks, > > After updating a postgres db for my django app Iam getting this error > when I try and save new data to the db: > > Request Method: POST > Request URL: http://10.50.253.200/admin/survey/gps/add/ > Django Version: 1.2 beta 1 > Exception Type: IntegrityError > Exception Value: > > duplicate key value violates unique constraint "django_admin_log_pkey" > > Is there any way to correct this? > > Thanks > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/1245de5c-d8fb-4930-a6f2-a273b2d38739%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: duplicate key value violates unique constraint "django_admin_log_pkey"
what Groups Google Don't access to my accout for Creating New Groups by Name "AmolMap" and tell this name created by i, but show this Groups? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/udCxIaihp3MJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: duplicate key value violates unique constraint "django_admin_log_pkey"
Thanks, this helped me too 2 years later.. :-) On Thursday, October 14, 2010 6:23:37 PM UTC+2, reduxionist wrote: > > On 14 ต.ค. 2010, at 22:24, glob...@iamsandiego.com wrote: > > > Hi Folks, > > > > After updating a postgres db for my django app Iam getting this error > > when I try and save new data to the db: > > > > Request Method: POST > > Request URL: http://10.50.253.200/admin/survey/gps/add/ > > Django Version: 1.2 beta 1 > > Exception Type: IntegrityError > > Exception Value: > > > > duplicate key value violates unique constraint "django_admin_log_pkey" > > > > Is there any way to correct this? > > Sounds to me like your DB update has reset the sequence > "django_admin_log_id_seq" used by postgres to get the next value for the > "auto-increment"-type id field used by django_admin_log. > > I would manually reset the sequence via the following: > > First get the id value of the last admin entry: > > select id from "django_admin_log" order by id desc limit 1; > > Then set the next value of the ID sequence to that + 1 via: > > select setval('django_admin_log_id_seq', LASTID+1); > > (replacing LASTID+1 with the result of the first query +1 obviously...) > > The other option would be to "delete * from 'django_admin_log';" so that > the old ids are gone and you can start over from 1 - but then you lose your > whole admin history which seems sub-optimal. > > Haven't run into the problem myself though, so this is just a guess, and > from a Django newbie so... > > Hope it helps! > Jonathan > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/29-tT_F6SlMJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: duplicate key value violates unique constraint "django_admin_log_pkey"
Jonathan - Thank you - select setval('django_admin_log_id_seq', LASTID+1); - worked ! I can breathe again. On Oct 14, 9:23?am, Jonathan Barratt <jonathan.barr...@knifeict.com> wrote: > On 14 ?.?. 2010, at 22:24, global...@iamsandiego.com wrote: > > > Hi Folks, > > > After updating a postgres db for my django app Iam getting this error > > when I try and save new data to the db: > > > Request Method: ? ?POST > > Request URL: ? ? ?## > > Django Version: ? ?1.2 beta 1 > > Exception Type: ? ?IntegrityError > > Exception Value: > > > duplicate key value violates unique constraint "django_admin_log_pkey" > > > Is there any way to correct this? > > Sounds to me like your DB update has reset the sequence > "django_admin_log_id_seq" used by postgres to get the next ?value for the > "auto-increment"-type id field used by django_admin_log. > > I would manually reset the sequence via the following: > > First get the id value of the last admin entry: > > select id from "django_admin_log" order by id desc limit 1; > > Then set the next value of the ID sequence to that + 1 via: > > select setval('django_admin_log_id_seq', LASTID+1); > > (replacing LASTID+1 with the result of the first query +1 obviously...) > > The other option would be to "delete * from 'django_admin_log';" so that the > old ids are gone and you can start over from 1 - but then you lose your whole > admin history which seems sub-optimal. > > Haven't run into the problem myself though, so this is just a guess, and from > a Django newbie so... > > Hope it helps! > Jonathan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: duplicate key value violates unique constraint "django_admin_log_pkey"
On 14 ?.?. 2010, at 22:24, global...@iamsandiego.com wrote: > Hi Folks, > > After updating a postgres db for my django app Iam getting this error > when I try and save new data to the db: > > Request Method: POST > Request URL: http://10.50.253.200/admin/survey/gps/add/ > Django Version: 1.2 beta 1 > Exception Type: IntegrityError > Exception Value: > > duplicate key value violates unique constraint "django_admin_log_pkey" > > Is there any way to correct this? Sounds to me like your DB update has reset the sequence "django_admin_log_id_seq" used by postgres to get the next value for the "auto-increment"-type id field used by django_admin_log. I would manually reset the sequence via the following: First get the id value of the last admin entry: select id from "django_admin_log" order by id desc limit 1; Then set the next value of the ID sequence to that + 1 via: select setval('django_admin_log_id_seq', LASTID+1); (replacing LASTID+1 with the result of the first query +1 obviously...) The other option would be to "delete * from 'django_admin_log';" so that the old ids are gone and you can start over from 1 - but then you lose your whole admin history which seems sub-optimal. Haven't run into the problem myself though, so this is just a guess, and from a Django newbie so... Hope it helps! Jonathan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
duplicate key value violates unique constraint "django_admin_log_pkey"
Hi Folks, After updating a postgres db for my django app Iam getting this error when I try and save new data to the db: Request Method: POST Request URL:http://10.50.253.200/admin/survey/gps/add/ Django Version: 1.2 beta 1 Exception Type: IntegrityError Exception Value: duplicate key value violates unique constraint "django_admin_log_pkey" Is there any way to correct this? Thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.