Simon,
Thanks for your considered comments.
On 2 Jul 2012, at 12:20, Simon Slavin wrote:
> Worth remembering that BLOBs don't have a well-ordering function. You can
> compare two BLOBs and tell whether they're the same (usually, but lossless
> encoding defeats this), but if they're not the same you can't put one
> 'before' the other.
OK, in the general case.
> This is because BLOBs are essentially black boxes. You have no idea what the
> data represents.
If I'm responsible for the data, I can take care that applying memcmp()
to two BLOBs is meaningful.
> If you know what it represented, you'd probably be storing it as text or a
> number.
I'm not sure I can depend on having 128-bit unsigned integers available.
Notational options make normalization necessary for text. With BLOB, I
can
use the result from inet_pton(); with TEXT, I have to apply inet_ntop()
to
the result of inet_pton(). Old-school parsimony makes me disinclined to
do this. Perhaps I need to lighten up?
> Think of storing images as BLOBs. How do you compare two images ?
I don't think the analogy applies.
Images belong to a different specialization of the same base class.
Thanks again,
Niall O'Reilly
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users