Handling differences between MS-SQL and PostgreSQL money datatypes
0
votes
1
answer
1473
views
This is a follow-up/ to my previous question https://dba.stackexchange.com/questions/183964/is-it-possible-to-insert-un-formatted-data-for-money-data-type-in-postgresql/184155#184155
1. I could read money data by typecasting it into numeric
SELECT '52093.89'::money::numeric
Will it give inconsistent data, rounded etc.. ?
2. As per ISO standard, the
money
datatype size is (19,4) but why PostgreSQL returns size as 2147483647? Is this size locale dependent?
3. Is it a good idea to use the money
datatype to store/retrieve locale specific values? If not, when is the money
datatype best suitable?
I have to use the money
datatype for certain cases. My worry is will I get any problems if I treat money
datatype values as decimal values?
I don't bother about locale specific values such as symbol, digit, and decimal grouping etc.. Can I store money datatype values as per lc_monetary
settings and reading by typecasting it to numeric
?
Asked by Ramesh Bathini
(61 rep)
Aug 24, 2017, 04:19 AM
Last activity: Apr 1, 2021, 05:45 AM
Last activity: Apr 1, 2021, 05:45 AM