Overflow from PostgreSQL numeric type

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
EvanStein
Posts: 4
Joined: Wed 09 Jul 2008 17:34

Overflow from PostgreSQL numeric type

Post by 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

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by 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.

EvanStein
Posts: 4
Joined: Wed 09 Jul 2008 17:34

Post by 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

Post Reply