The situation:
Pg table with a numeric(19,4) column.
Value in colum is inserted as 310000000 (310 million)
selecting this value gives 3100000000000 (4 digits added to the end that maybe should be decimals?)
Oddly enough: select 310000000::numeric(19,4) gives the correct result.
I think it has something to do with how the column type is interpreted as stCurrency vs stBigDecimal, but I'm having a hard time debugging this (the WITH statements are really hard to debug around!)
Can anyone confirm this issue? I'm still looking into it, but I'm not making much headway yet.
Here's a script for testing:
Code: Select all
create table pgnumtest(
num numeric(19,4)
);
insert into pgnumtest values (310000000);
select num, 310000000::numeric(19,4) from pgnumtest;
Code: Select all
num numeric
------------- ---------
3100000000000 310000000