#35625: ProgrammingError with Postgres backend when setting db_default and constraint using the LIKE operator -------------------------------------+------------------------------------- Reporter: Julien Chaumont | Owner: Simon | Charette Type: Bug | Status: closed Component: Migrations | Version: 5.0 Severity: Release blocker | Resolution: fixed Keywords: db_default, | Triage Stage: Ready for postgres | checkin Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------------+------------------------------------- Changes (by Sarah Boyce <42296566+sarahboyce@…>):
* resolution: => fixed * status: assigned => closed Comment: In [changeset:"f359990e4909db8722820849d61a6f5724338723" f359990e]: {{{#!CommitTicketReference repository="" revision="f359990e4909db8722820849d61a6f5724338723" Fixed #35625 -- Fixed a crash when adding a field with db_default and check constraint. This is the exact same issue as refs #30408 but for creating a model with a constraint containing % escapes instead of column addition. All of these issues stem from a lack of SQL and parameters separation from the BaseConstraint DDL generating methods preventing them from being mixed with other parts of the schema alteration logic that do make use of parametrization on some backends (e.g. Postgres, MySQL for DEFAULT). Prior to the addition of Field.db_default and GeneratedField in 5.0 parametrization of DDL was never exercised on model creation so this is effectively a bug with db_default as the GeneratedField case was addressed by refs #35336. Thanks Julien Chaumont for the report and Mariusz Felisiak for the review. }}} -- Ticket URL: <https://code.djangoproject.com/ticket/35625#comment:4> 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 django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/01070190e86f7a58-7c667394-f6ce-4e2b-a8b2-012a53a69e32-000000%40eu-central-1.amazonses.com.