`psycopg2.IntegrityError: duplicate key value violates unique constraint
"tags_pkey"`
The PrimaryKey is an IntegerField with a modified `db_column`.
--
Ticket URL: <https://code.djangoproject.com/ticket/29126>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Comment (by Tim Graham):
Can you please include the model and steps to reproduce?
--
Ticket URL: <https://code.djangoproject.com/ticket/29126#comment:1>
* type: Bug => Cleanup/optimization
* has_patch: 0 => 1
* component: Database layer (models, ORM) => Documentation
* stage: Unreviewed => Accepted
Comment:
If I understand the situation you're describing, I believe this is
expected behavior (see #8419). [https://github.com/django/django/pull/9698
PR] to document and test it.
--
Ticket URL: <https://code.djangoproject.com/ticket/29126#comment:2>
* status: new => closed
* resolution: => fixed
Comment:
Oh, thanks a lot for pointing it out and updating the documentation!
--
Ticket URL: <https://code.djangoproject.com/ticket/29126#comment:3>
Comment (by Tim Graham <timograham@…>):
In [changeset:"e917ea6bec45d7f789ca96a13be15df9521963e1" e917ea6b]:
{{{
#!CommitTicketReference repository=""
revision="e917ea6bec45d7f789ca96a13be15df9521963e1"
Fixed #29126 -- Doc'd the behavior of QuerySet.update_or_create() with
manually specified pks.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29126#comment:4>
Comment (by Tim Graham <timograham@…>):
In [changeset:"4b8e433e1cacd7405d6ae0a88d1776adc0068f10" 4b8e433]:
{{{
#!CommitTicketReference repository=""
revision="4b8e433e1cacd7405d6ae0a88d1776adc0068f10"
[2.0.x] Fixed #29126 -- Doc'd the behavior of QuerySet.update_or_create()
with manually specified pks.
Backport of e917ea6bec45d7f789ca96a13be15df9521963e1 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29126#comment:5>