Page 1 of 1

UUID fields are mapped as TStringField rather than TWideStringField

Posted: Mon 10 Oct 2016 18:05
by roberto.schneiders
I have a problem with the field mapping for native uuid fields on PostgreSQL (9.5).

We use UseUnicode=True and UnknownAsString=True, but the field is mapped as TStringField, it should be TWideStringField.

The documentation:
UseUnicode (=True)
When set to True all character data is stored as WideStrings and TStringField is replaced with TWideStringFiled.
UnknownAsString (=True)
If True, fields of unknown data types are mapped to TStringField or TWideStringField depending on the value of the UseUnicode option.
We are migrating the database fields from character(38) to native uuid fields and we expect the field mappings to be the same (or compatible).

I don't see any reason why the uuid fields would be mapped as TStringField on a Unicode database. It looks like a bug.

if anyone knows a way to workaround this, we'll apreciate it.

*A coworker already sent this problem to the support a week ago, but they don't answer.

Re: UUID fields are mapped as TStringField rather than TWideStringField

Posted: Tue 11 Oct 2016 09:36
by azyk
The driver represents the UUID value as a string value consisting of the HEX digits of the 128-bit sequence. But UUID in PostgreSQL is not a string data type, that's why this field won't be mapped in WideString when UseUnicode=True. This behavior is correct. For more information on the UUID type, refer to the PostgreSQL documentation: https://www.postgresql.org/docs/9.6/sta ... -uuid.html

Please describe in more detail the reason of the UUID value mapping to WideString.