google-code-export / dataobjectsdotnet

Automatically exported from code.google.com/p/dataobjectsdotnet
0 stars 0 forks source link

GUID type must be mapped to UUID type in PostgreSQL >= 8.3 #734

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Subj. 

uuid type is supported starting from v8.3.

Original issue reported on code.google.com by alex.yakunin on 9 Jul 2010 at 7:50

GoogleCodeExporter commented 9 years ago
You need to add:
    public override DataTypeCollection GetDataTypesInfo()
    {
        var commonFeatures =
        DataTypeFeatures.Clustering |
        DataTypeFeatures.Grouping |
        DataTypeFeatures.Indexing |
        DataTypeFeatures.KeyConstraint |
        DataTypeFeatures.Nullable |
        DataTypeFeatures.Ordering |
        DataTypeFeatures.Multiple |
        DataTypeFeatures.Default;

        DataTypeCollection dtc =  base.GetDataTypesInfo();
        dtc.Guid = DataTypeInfo.Stream(SqlType.Guid, commonFeatures, 32, "uuid");

        return dtc;
    }
in namespace Xtensive.Sql.PostgreSql.v8_3 in class ServerInfoProvider

and
change the Guid translation from varchar to uuid:

        if (type==typeof(Guid))
          return "uuid";

in method private static string TranslateClrType(Type type) in class Translator

and remove Guid from method public override bool IsParameterCastRequired(Type 
type) in TypeMapper.

I can send patch if you want. I've tested it on 4.2.4 and everything is ok.

Regards,
Karol Wojtaszek

Original comment by sekret...@gmail.com on 21 Aug 2010 at 5:02

GoogleCodeExporter commented 9 years ago
There should be no problems when you change it in 4.3 branch;)

Original comment by sekret...@gmail.com on 21 Aug 2010 at 5:04

GoogleCodeExporter commented 9 years ago
That would be nice.

Thanks in advance!

Original comment by Dmitri.Maximov on 21 Aug 2010 at 7:22

GoogleCodeExporter commented 9 years ago
fixed ?:)

Original comment by v.tambov...@gmail.com on 2 Feb 2011 at 10:41