Hi,

> Maybe something like this could be added to the documentation:
> (Copied from wikipedia)

I think that UUID is not a h2 specific thing so there is no reason to
steal work from google and wikipedia.

> I assume that if someone does not provide all 32 digits and 4 hyphens an
> exception is thrown?
> Further a byte array of exactly 16 bits must be provided?

My opinion that the behavior you describing is better than trying to
parse everything and just ignoring format errors so that result may
become unpredictable but current implementation does exactly that.. I
think this can be considered as a bug.

> I don't remember what the literal representation of a binary is but I am
> quessing it is a hexadecimal string.
> So UUID is BINARY(16) with the 4 hyphens added to the literal
> representation, right?

I don't know if literal representation of binary is standardized. It
seems that it is not. Different databases can use different
representation. Even if it based on hex it may start from 0x but also
may not to. For example postgres uses '\x123ABC' notation. So your
description is still not exact. UUID is different type and internally
in h2 it is even not based on BINARY. For real I think that parallels
between these two types are meaningless at all. The same way we can
say that BIGINT is just a BINARY(8) with supports of +-*/ and other
numeric operations. Lets do not be an architecture astronauts:)

> But then why should we keep VARBINARY and BLOB separate?
>  From user's point of view there is no difference.
> The only dilemma this separation is trying to solve is how to deal with
> values that are big.

For the most of cases you will be right but sometimes for performance
reasons there should be per column distinction on how we will decide
if this object small enough to handle it as byte array. Since there is
no standard way to do this in sql so separation between BINARY and
BLOB seems to be a not so bad decision, not an ideal though.

regards,
S.Vladykin

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to