diff options
| author | Shai Berger <shai@platonix.com> | 2013-10-21 18:12:48 +0300 |
|---|---|---|
| committer | Shai Berger <shai@platonix.com> | 2013-10-23 15:01:05 +0300 |
| commit | 27f3f341369c8e18ea4a360a1f7c01531836b68b (patch) | |
| tree | 21a7ffc890ccb9bada74242231fa83d0a66b3085 /docs/ref/databases.txt | |
| parent | 9c982053f4d9c9696214d7c20ab32204d27e4a94 (diff) | |
Fixed #13245: Explained Oracle's behavior w.r.t db_table
and how to prevent table-name truncation
Thanks russellm & timo for discussion, and timo for review.
Backported from master 317040a73b77be8f8210801793b2ce6d1a69301e
Diffstat (limited to 'docs/ref/databases.txt')
| -rw-r--r-- | docs/ref/databases.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt index d628a541e9..884613a136 100644 --- a/docs/ref/databases.txt +++ b/docs/ref/databases.txt @@ -762,6 +762,22 @@ Naming issues Oracle imposes a name length limit of 30 characters. To accommodate this, the backend truncates database identifiers to fit, replacing the final four characters of the truncated name with a repeatable MD5 hash value. +Additionally, the backend turns database identifiers to all-uppercase. + +To prevent these transformations (this is usually required only when dealing +with legacy databases or accessing tables which belong to other users), use +a quoted name as the value for ``db_table``:: + + class LegacyModel(models.Model): + class Meta: + db_table = '"name_left_in_lowercase"' + + class ForeignModel(models.Model): + class Meta: + db_table = '"OTHER_USER"."NAME_ONLY_SEEMS_OVER_30"' + +Quoted names can also be used with Django's other supported database +backends; except for Oracle, however, the quotes have no effect. When running syncdb, an ``ORA-06552`` error may be encountered if certain Oracle keywords are used as the name of a model field or the |
