#28668: Add ON CONFLICT support to QuerySet.bulk_create()
-------------------------------------+-------------------------------------
Reporter: Tom Forbes | Owner: Tom
| Forbes
Type: New feature | Status: assigned
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Дилян Палаузов):
Let's start with the most complex case: calling
{{{.objects.bulk_create(..., on_conflict='ignore')}}} where the caller
wants to determine which of the supplied objects were actually inserted
(in order to call signals on them). We can start with the attached
minimalistic patch, which does this for Postgresql as only RDBMS allowing
efficient handling of this most complex case, and see how to implement it
in the other RDBMs.
Unfortunately, the sequence counter is automatically increased for each
object provided as parameter, even if at the end the object was already in
the database.
I propose extending the logic for bulk_create to send implicit post_save
signals for Postgresql.
--
Ticket URL: <https://code.djangoproject.com/ticket/28668#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/061.8f705b44f0a7b0e8bcc505c0e2eeca43%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.