#24040: _meta.db_table malformed in SQL statement when >31char
-------------------------------------+-------------------------------------
Reporter: JorisBenschop | Owner: nobody
Type: Uncategorized | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
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 JorisBenschop):
Replying to [comment:4 timgraham]:
> Are you complaining about having to quote the name on a legacy database?
The rationale for hashing the name is to prevent tables with models with
the same first 32 characters from conflicting. That is why simply
truncating the name isn't a sufficient solution.
My primary issue was that I failed to miss the documentation that
described this limitation. Stackoverflow issues suggest I use
db_table='schema\".\".actual_table', which gives an error.
What I am complaining about is that the hashing is not a good solution,
because it '''always''' creates a cryptic error at the database level
which is difficult to catch at application level. Instead of the hashing,
an error should be raised at the application level explaining to the user
that the name is too long. IMO this is not more code than the hashing,
does not annoy the DB backend by trying to retrieve data from non-existent
tables and thus results in better software.
Currently there is code that splits the schema and table name. Adding a
single "assert len()" at that position will make life easier for oracle
users.
again, thanks for your time and patience
--
Ticket URL: <https://code.djangoproject.com/ticket/24040#comment:5>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/071.7b0748adfaefb849122d8b6fd73b88db%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.