#33647: bulk_update silently truncating values for size limited fields
-------------------------------------+-------------------------------------
     Reporter:  jerch                |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  4.0
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    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:

 > Then only postgres is affected here?

 yep, if you set this feature flag to `False` on
 
[https://github.com/django/django/blob/6723a26e59b0b5429a0c5873941e01a2e1bdbb81/django/db/backends/postgresql/features.py#L52
 the Postgres backend] and run the `queries.test_bulk_update` you'll be
 able to see why it was added in the first place.

 > In general the broader "super" type with no constraints can be derived
 in postgres like this:
 > ...
 > Maybe it is enough to apply the super type to the cast in that line

 That could be one approach yes, we'd likely need to adapt `CAST` to allow
 for such usage though. Not sure of what the argument should be named
 though, maybe `generic` which defaults to `False`? Not sure what
 `generic=True` would mean in the case of `Cast(expr,
 ArrayField(CharField(max_length=20), generic=True)` would it be
 `::varchar[]` or `::array`.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33647#comment:3>
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/010701803d6544fc-450a1bc0-740d-4bde-b0d8-b1aff461047e-000000%40eu-central-1.amazonses.com.

Reply via email to