Hello,

One of my tables contains a number of LargeBinary columns (holding custom 
types of encrypted data). I'd like to ensure that one of these columns 
contains unique data, and thus added `unique=True` to its `Column()` 
definition.

However, as per this thread 
<https://stackoverflow.com/questions/28298522/unique-constraint-for-varbinary-column#28298683>
 
it seems to me that only the first 900 bytes are considered when checking 
that constraint; I read similar notes someplace else but can't find the 
reference atm. I currently use MySQL, but will switch to PostgreSQL soon.

Is this limitation DB specific?

An alternative solution to this would be to add a second column that 
contains a hash over the binary data, and then compare that hash. 
Considering the above limitation, that would probably the next best 
approach?

Thanks!
Jens

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy-alembic+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to