Subject Re: [firebird-support] Primary Key - GUID
Author Lester Caine
Pavel Menshchikov wrote:

> As Adam said, use CHAR. To generate GUIDs you need a UDF (uuidlib, for
> example). Note that "compact" form of a GUID (UUID, which could be
> saved as CHAR(22)) is more suitable/efficient for indexing in FB than
> a "regular" form of a GUID (which could be saved as CHAR(36) excluding
> brackets).

Just to clarify this.
GUID is a Microsoft 'standard' and is required where certain Microsoft
operations are carried out.
UUID is different to GUID, and while it IS more compact, it can not be
used interchangeably as a GUID ( as I understand it ) as it does not use
the same rules for creating it.
The uuidlib can be asked to produce an identifier that does not follow
the UUID rules, but is re-ordered to produce something which is better
for indexing in Firebird. The standard Unix UUID is not.
I know I am being 'picky' - In theory all the results will be unique
identifiers - but it is possible to 'unpick' the identifier and verify
the core data that was used - something that may be lost by
'compacting', and would not exist if the source was a UUID translated to
a GUID layout. So some security checks will flag problems with a UUID or
GUID if it does not match the machine ID that it is flagged as being
generated by. Not a problem to 99.9% of users but we always seem to hit
that 0.1% more often ....

Lester Caine
L.S.Caine Electronic Services
Treasurer - Firebird Foundation Inc.