Uuid data type as a string data type

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
tommyiraone
Posts: 9
Joined: Thu 13 Dec 2018 07:25

Uuid data type as a string data type

Post by tommyiraone » Tue 09 Jul 2019 05:21

Hi, we are migrating an existing application from Corelab.Postgresql to dotconnect for Postgresql but constrained by the many Uuid data types that are treated as a string data type.

can dotconnect treat Uuid data type as a string as in Corelab. Postgresql?

string _oid = par_ds.Tables ("os"). Rows (i). Item ("oid");

CoreLab.PostgreSql => OK
DotConnect PostgreSql => ERROR

we cannot use the search and replace feature, I'm afraid.., it's too many cases.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Uuid data type as a string data type

Post by Pinturiccio » Tue 09 Jul 2019 13:31

The UUID type is mapped to System.Guid. It is the designed behaviour. And we recommend you to use Guid values instead of string ones and replace code that casts them to strings in your program. If it is not possible or will take a lot of time, we can create a static class with a static property, which will force returning string values from UUID columns. Please post here whether such solution suits you.

tommyiraone
Posts: 9
Joined: Thu 13 Dec 2018 07:25

Re: Uuid data type as a string data type

Post by tommyiraone » Tue 09 Jul 2019 18:53

i know, but when using CoreLab.PostgreSql, we did not cast to anything, it just works, but when we migrate to the latest version of dotconnect.. all uuid columns stop working, invalid data type.

we use old CoreLab.PostgreSql (PostgreSQLDirect .NET)

we are migrating from Net Framework 2.0 to 4.7 (VS 2008 to VS 2017)

can you give me an example on how to "create a static class with a static property, which will force returning string values from UUID columns" please?


Shalex
Site Admin
Posts: 8905
Joined: Thu 14 Aug 2008 12:44

Re: Uuid data type as a string data type

Post by Shalex » Tue 16 Jul 2019 17:04

Sorry for the delay.
tommyiraone wrote:
Tue 09 Jul 2019 18:53
can you give me an example on how to "create a static class with a static property, which will force returning string values from UUID columns" please?
We will implement this option (static property) and provide the internal build to you.

Shalex
Site Admin
Posts: 8905
Joined: Thu 14 Aug 2008 12:44

Re: Uuid data type as a string data type

Post by Shalex » Fri 19 Jul 2019 09:15

The build is provided by email.

tommyiraone
Posts: 9
Joined: Thu 13 Dec 2018 07:25

Re: Uuid data type as a string data type

Post by tommyiraone » Sat 20 Jul 2019 23:40

it works like a charm, thank you.

Post Reply