On Fri, Dec 18, 2009 at 9:00 AM, Peter Herndon <tphern...@gmail.com> wrote:
> Hi all,
>
> I've run into a situation where syncdb produces an error on one of my models 
> against Oracle, but not against Postgres.  Using Postgres, one can mark a 
> TextField as unique=True, and syncdb works just fine.  Using Oracle, you get 
> an error:
>
>> cx_Oracle.DatabaseError: ORA-02329: column of datatype LOB cannot be
>> unique or a
>> primary key
>
> The error is occurring for someone using some code of mine 
> (django-ldap-groups), rather than something I'm seeing directly.  I don't 
> currently have access to an Oracle instance to test against.  FWIW, I 
> remember running into this sort of limitation back when I used Oracle a few 
> years ago, any LOB field was basically opaque -- no indexing, no uniqueness, 
> etc.
>
> Is this limitation known?  Is this an error on my part, that I shouldn't be 
> trying to mark a TextField as unique?  Or should this be something that 
> should be specially handled by the Oracle backend somewhere?  If the latter, 
> I'm happy to file a bug report.

This is known.  The Oracle notes [1] mention that TextFields cannot be
indexed.  Since Oracle requires indexes for unique columns, this also
means they cannot be unique, although we should probably make that
explicit.  It may also be worthwhile to check for this when the models
are validated.

Ian

[1] http://docs.djangoproject.com/en/1.1/ref/databases/#textfield-limitations

--

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


Reply via email to