#35336: Adding GeneratedField fails with ProgrammingError when using When on
CharField
-------------------------------------+-------------------------------------
Reporter: Adrian Garcia | Owner: Simon
| Charette
Type: Bug | Status: assigned
Component: Database layer | Version: 5.0
(models, ORM) |
Severity: Release blocker | Resolution:
Keywords: postgres, | Triage Stage: Accepted
generatedfield, contains |
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Simon Charette):
> are there plans for a more unified SQL translator in a future release
I think the many regressions we've run into in the past releases in
escaping DDL (the subset of SQL for defining objects) in the schema editor
(the component behind migrations) warrants spending time having a less
convoluted approach.
I think that we should experiment with having backends denote whether or
not they support parametrized DDL (the ability to call
`Cursor.execute(ddl: str, params: tuple)` over having the schema editor do
the `%` formatting itself), make sure all parts of the scheme editor
return `(str, tuple)` and never simply `str`, and then adjust
`SchemaEditor.execute` to do `cursor.execute(ddl, params)` when
`connection.features.support_parametrized_dll` and do `cursor.execute(ddl
% map(self.quote_value, params), None)` otherwise.
--
Ticket URL: <https://code.djangoproject.com/ticket/35336#comment:6>
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/0107018e9f8105d6-641eed1b-7078-4aba-9793-ee74590b4484-000000%40eu-central-1.amazonses.com.