PostgreSQL: Which Datatype should be used for Currency?

Spread the love

Question Description

Seems like Money type is discouraged as described here

My application needs to store currency, which datatype shall I be using? Numeric, Money or FLOAT?

Practice As Follows

Numeric with forced 2 units precision. Never use float or float like datatype to represent currency because if you do, people are going to be unhappy when the financial report’s bottom line figure is incorrect by + or – a few dollars.

The money type is just left in for historical reasons as far as I can tell.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.