On Fri, 2009-03-13 at 19:29 -0700, Sergio wrote:
> 
> 
> On Mar 14, 2:23 am, Malcolm Tredinnick <malc...@pointy-stick.com>
> wrote:
> > Character fields in Django can never be NULL. They will either be empty
> > (and stored as '') or not empty, but never stored as NULL in the
> > database.
> 
> thanks for your answer. Could you please give more insight on this
> note?
> 
> "When using the Oracle database backend, the null=True option will be
> coerced for string-based fields that have the empty string as a
> possible value, and the value NULL will be stored to denote the empty
> string."

It's an implementation detail that makes no difference in practice. It
talks about what is sent to the database, not how it looks at the Django
level.

Oracle has a long-standing bug in their SQL implementation in that ''
and NULL compare as equal (they won't fix it because it would break
untold amounts of existing code in their customers' applications), so
NULL / '' handling in things talking to Oracle databases is almost the
exact opposite of fun. Django hides that pain from you for the most
part. The note indicates that if you looked at the field object in the
model when using the Oracle backend, you would  see null=True (so it's
not entirely transparent).

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to