Re: Postgresql Sequence update on data migration
Hi! I think you've found the wrong mailing list for this post. This mailing list is for discussing the development of Django itself, not for support using Django. This means the discussions of bugs and features in Django itself, rather than in your code using it. People on this list are unlikely to answer your support query with their limited time and energy. For support, please follow the "Getting Help" page: https://docs.djangoproject.com/en/stable/faq/help/ . This will help you find people who are willing to support you, and to ask your question in a way that makes it easy for them to answer. Thanks for your understanding and all the best, Adam On Wed, May 25, 2022 at 7:10 PM mohammad ali mehdizadeh < am.civi...@gmail.com> wrote: > Matthew thank you for your attention > I mean we have a scenario that can make errors. > We have a sequence for a primary key, if we insert some objects with > predefined `id` and then we let the sequence create a key for us, then we > will have a duplicate primary key error. > Do you mind django want to prevent it? > Or it's developer responsibility? > > On Wed, May 25, 2022 at 7:03 PM Matthew Pava wrote: > >> Please see: >> >> https://docs.djangoproject.com/en/dev/ref/django-admin/#sqlsequencereset >> >> >> >> Also, this question is more for the Django Users mailing list than the >> Django Developers mailing list. >> >> >> >> *From:* django-developers@googlegroups.com < >> django-developers@googlegroups.com> *On Behalf Of *mohamad ali mehdizadeh >> *Sent:* Wednesday, May 25, 2022 1:23 AM >> *To:* Django developers (Contributions to Django itself) < >> django-developers@googlegroups.com> >> *Subject:* Postgresql Sequence update on data migration >> >> >> >> I have a migration from an old table to a new table, so when I migrate >> also data of old table, I try to keep PrimaryKey values the same as old >> table. so every thing go well until I see primary key duplicate value >> errors from Postgresql, I check it and so the Sequence of the new table was >> not get the last_value of the old table, >> I doubt that is it the responsibility of developer to take it to the >> account or Django can help developer here? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django developers (Contributions to Django itself)" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-developers+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-developers/fd70a069-0704-40b7-9fe9-e59d87fef22an%40googlegroups.com >> <https://us-east-2.protection.sophos.com?d=google.com=aHR0cHM6Ly9ncm91cHMuZ29vZ2xlLmNvbS9kL21zZ2lkL2RqYW5nby1kZXZlbG9wZXJzL2ZkNzBhMDY5LTA3MDQtNDBiNy05ZmU5LWU1OWQ4N2ZlZjIyYW4lNDBnb29nbGVncm91cHMuY29tP3V0bV9tZWRpdW09ZW1haWwmdXRtX3NvdXJjZT1mb290ZXI==NWVjN2YxNzUxNGEyNzMxNmMyMGRkZGU1=TzFrcXFEMVFUaHg3VS9iWWtZcEFpNXpDOHlVMkdXemx6UWl5RW5GdDRtVT0==90200e729fae4913bde29ed6523fab68> >> . >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django developers (Contributions to Django itself)" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to django-developers+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-developers/13a63536e5114b27938bd23d518350c3%40Exchange.ISS.LOCAL >> <https://groups.google.com/d/msgid/django-developers/13a63536e5114b27938bd23d518350c3%40Exchange.ISS.LOCAL?utm_medium=email_source=footer> >> . >> > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/CAHFc_GdP_kufUVk7-uYEH%3DOs_pFUqzaaEEqJOBuXNXGBOz%2Bwnw%40mail.gmail.com > <https://groups.google.com/d/msgid/django-developers/CAHFc_GdP_kufUVk7-uYEH%3DOs_pFUqzaaEEqJOBuXNXGBOz%2Bwnw%40mail.gmail.com?utm_medium=email_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAMyDDM0yc4JmZmyOi%3D8Wn9eiq%2B6vfyc4Y9Y23uGC_RQHxAtAAw%40mail.gmail.com.
Re: Postgresql Sequence update on data migration
Matthew thank you for your attention I mean we have a scenario that can make errors. We have a sequence for a primary key, if we insert some objects with predefined `id` and then we let the sequence create a key for us, then we will have a duplicate primary key error. Do you mind django want to prevent it? Or it's developer responsibility? On Wed, May 25, 2022 at 7:03 PM Matthew Pava wrote: > Please see: > > https://docs.djangoproject.com/en/dev/ref/django-admin/#sqlsequencereset > > > > Also, this question is more for the Django Users mailing list than the > Django Developers mailing list. > > > > *From:* django-developers@googlegroups.com < > django-developers@googlegroups.com> *On Behalf Of *mohamad ali mehdizadeh > *Sent:* Wednesday, May 25, 2022 1:23 AM > *To:* Django developers (Contributions to Django itself) < > django-developers@googlegroups.com> > *Subject:* Postgresql Sequence update on data migration > > > > I have a migration from an old table to a new table, so when I migrate > also data of old table, I try to keep PrimaryKey values the same as old > table. so every thing go well until I see primary key duplicate value > errors from Postgresql, I check it and so the Sequence of the new table was > not get the last_value of the old table, > I doubt that is it the responsibility of developer to take it to the > account or Django can help developer here? > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/fd70a069-0704-40b7-9fe9-e59d87fef22an%40googlegroups.com > <https://us-east-2.protection.sophos.com?d=google.com=aHR0cHM6Ly9ncm91cHMuZ29vZ2xlLmNvbS9kL21zZ2lkL2RqYW5nby1kZXZlbG9wZXJzL2ZkNzBhMDY5LTA3MDQtNDBiNy05ZmU5LWU1OWQ4N2ZlZjIyYW4lNDBnb29nbGVncm91cHMuY29tP3V0bV9tZWRpdW09ZW1haWwmdXRtX3NvdXJjZT1mb290ZXI==NWVjN2YxNzUxNGEyNzMxNmMyMGRkZGU1=TzFrcXFEMVFUaHg3VS9iWWtZcEFpNXpDOHlVMkdXemx6UWl5RW5GdDRtVT0==90200e729fae4913bde29ed6523fab68> > . > > -- > You received this message because you are subscribed to the Google Groups > "Django developers (Contributions to Django itself)" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-developers+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-developers/13a63536e5114b27938bd23d518350c3%40Exchange.ISS.LOCAL > <https://groups.google.com/d/msgid/django-developers/13a63536e5114b27938bd23d518350c3%40Exchange.ISS.LOCAL?utm_medium=email_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/CAHFc_GdP_kufUVk7-uYEH%3DOs_pFUqzaaEEqJOBuXNXGBOz%2Bwnw%40mail.gmail.com.
RE: Postgresql Sequence update on data migration
Please see: https://docs.djangoproject.com/en/dev/ref/django-admin/#sqlsequencereset Also, this question is more for the Django Users mailing list than the Django Developers mailing list. From: django-developers@googlegroups.com On Behalf Of mohamad ali mehdizadeh Sent: Wednesday, May 25, 2022 1:23 AM To: Django developers (Contributions to Django itself) Subject: Postgresql Sequence update on data migration I have a migration from an old table to a new table, so when I migrate also data of old table, I try to keep PrimaryKey values the same as old table. so every thing go well until I see primary key duplicate value errors from Postgresql, I check it and so the Sequence of the new table was not get the last_value of the old table, I doubt that is it the responsibility of developer to take it to the account or Django can help developer here? -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com<mailto:django-developers+unsubscr...@googlegroups.com>. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/fd70a069-0704-40b7-9fe9-e59d87fef22an%40googlegroups.com<https://us-east-2.protection.sophos.com?d=google.com=aHR0cHM6Ly9ncm91cHMuZ29vZ2xlLmNvbS9kL21zZ2lkL2RqYW5nby1kZXZlbG9wZXJzL2ZkNzBhMDY5LTA3MDQtNDBiNy05ZmU5LWU1OWQ4N2ZlZjIyYW4lNDBnb29nbGVncm91cHMuY29tP3V0bV9tZWRpdW09ZW1haWwmdXRtX3NvdXJjZT1mb290ZXI==NWVjN2YxNzUxNGEyNzMxNmMyMGRkZGU1=TzFrcXFEMVFUaHg3VS9iWWtZcEFpNXpDOHlVMkdXemx6UWl5RW5GdDRtVT0==90200e729fae4913bde29ed6523fab68>. -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/13a63536e5114b27938bd23d518350c3%40Exchange.ISS.LOCAL.
Postgresql Sequence update on data migration
I have a migration from an old table to a new table, so when I migrate also data of old table, I try to keep PrimaryKey values the same as old table. so every thing go well until I see primary key duplicate value errors from Postgresql, I check it and so the Sequence of the new table was not get the last_value of the old table, I doubt that is it the responsibility of developer to take it to the account or Django can help developer here? -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-developers+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/fd70a069-0704-40b7-9fe9-e59d87fef22an%40googlegroups.com.