#35271: Old migrations with UniqueConstraint fail when using psycopg3
--------------------------------+--------------------------------------
     Reporter:  Adam Zahradník  |                    Owner:  nobody
         Type:  Bug             |                   Status:  closed
    Component:  Migrations      |                  Version:  5.0
     Severity:  Normal          |               Resolution:  invalid
     Keywords:                  |             Triage Stage:  Unreviewed
    Has patch:  0               |      Needs documentation:  0
  Needs tests:  0               |  Patch needs improvement:  0
Easy pickings:  0               |                    UI/UX:  0
--------------------------------+--------------------------------------
Comment (by David Sanders):

 ok thanks for checking 👍

 Iterables are valid expressions so I doubt that would be something that
 would be the correct approach.

 If anything, the index should probably coerce basic types list list into
 their `Value(…)` counterparts as this solves the issue and is something
 that is done for `db_default` already to solve precisely this issue.  To
 explain: psycopg (3) changed the way lists are rendered as SQL from
 `ARRAY['foo', 'bar']` to simply `{"foo", "bar"}`. The issue is the
 ambiguous string which requires casting; and `Value()` expressions are
 cast.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35271#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/0107018e117a63b8-c61f2562-a731-478e-8b69-3f4a1031d842-000000%40eu-central-1.amazonses.com.

Reply via email to