#34943: Support passing unique constraint names to bulk_create().
-------------------------------------+-------------------------------------
     Reporter:  Alex Vandiver        |                    Owner:  Sujay
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  dev
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  bulk insert update   |             Triage Stage:  Accepted
  upsert                             |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

 * cc: Simon Charette (added)


Comment:

 Makes sense.

 I guess that from an application maintenance perspective there are still
 benefits in using references to already defined constraint though, think
 of urlpattern names, annotations, lookups.

 To take back the example above nothing would prevent the ORM from simply
 resolving `unique_constraint='unique_profile_stream_topic'` to
 `('user_profile_id', 'stream_id', Upper('topic_name'))` and avoid the
 database level usage of `ON CONFLICT ON CONSTRAINT` if that's discouraged.

 In other words, the ''aliasing'' capabilities could be solely done at the
 application level assuming users opt-in into the usage of
 `Meta.constraints`. That would also happen to address the issue involved
 in dealing with the difference between unique indexes and constraints as
 Postgres treat them differently.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34943#comment:7>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018b97763d37-a7ccdb89-a668-4c7d-9d12-bdcc96847f21-000000%40eu-central-1.amazonses.com.

Reply via email to