Overflow from PostgreSQL numeric type

Overflow from PostgreSQL numeric type

Postby EvanStein » Wed 09 Jul 2008 18:53

Hi.

I've just experienced an overflow while dereferencing a DataReader. Apparently the value was too large for C# type Decimal. The column was a PostgreSQL numeric, and the value had infinitely repeating decimal places (it was something like 2/3).

I worked around this by using the round() function in the query, to specify the maximum number of decimal places. However, I'm wondering whether there's some neater way to do this.

I'm also wondering whether is it correct for the DataReader to throw an exception when encountering a value like this.

I'd be grateful for any insights!

Thanks,
Evan
EvanStein
 
Posts: 4
Joined: Wed 09 Jul 2008 17:34

Postby AndreyR » Tue 15 Jul 2008 10:01

Hello, Evan.

Thank you for the bug report, the issue will be fixed.
But the situation is quite involved, and no timeframe is available.
As a temporary solution, you can keep using round() function.

Regards, Andrey.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby EvanStein » Tue 15 Jul 2008 11:57

Thanks, Andrey.

I don't remember this clearly, but I did encounter something similar using the Oracle .NET provider. They might have even told us that the behaviour was correct!

Sorry to cause you grief, though in the end, an already-strong product will be even stronger. Best of luck with your work.

Regards,
Evan
EvanStein
 
Posts: 4
Joined: Wed 09 Jul 2008 17:34


Return to dotConnect for PostgreSQL