#25962: inspectdb for oracle nvarchar2 could miscalculate field size 2-fold
----------------------------------------------+--------------------
     Reporter:  JorisBenschop                 |      Owner:  nobody
         Type:  Uncategorized                 |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.9
     Severity:  Normal                        |   Keywords:  Oracle
 Triage Stage:  Unreviewed                    |  Has patch:  0
Easy pickings:  0                             |      UI/UX:  0
----------------------------------------------+--------------------
 Hi, I've noticed a consistent discrepancy between Oracle tables and django
 inspectdb results when it comes to NVARCHAR2 data types. Let's say I add
 this column to my table:
 {{{
 alter table STUDY add (TREATMENT NVARCHAR2(500));
 }}}
 If I then run manage.py inspectdb, I see the following result:
 {{{
  treatment = models.CharField(max_length=1000, blank=True, null=True)
 }}}
 From the oracle docs:
 {{{
 The NVARCHAR2 datatype is a Unicode-only datatype. When you create a table
 with an NVARCHAR2 column, you supply the maximum number of characters it
 can hold.
 }}}

 Now most likely I'm making a calculation mistakes, but to me this seems
 that the column allows for a 500 character input, whereas Django will
 allow a 1000 character input instead. If this is indeed the case, I guess
 this is the result from the 16bit input format that NVARCHAR2 has compared
 to 8-bit VARCHAR2.

 My apologies if this is documented, already reported or just stupidity

--
Ticket URL: <https://code.djangoproject.com/ticket/25962>
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/056.a2fbb8b5c6eb35aa46756c141b83fb86%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to