database schema - Using PostgreSQL's money type instead of numeric -


i'm thinking of converting numeric columns of pg 9.2 database schema money, because of benefits see (or imagine?) in having rounding , formatting handled @ db level, instead of application level. there downsides decision?

stick numeric:

  1. it faster have heard

  2. output consistent. means consistent. questions of whether enforce rounding @ storage or @ retrieval (or in application) left you. there many cases in fact may want store fractional cents , numeric lets safely.

the other thing if ever want add multicurrency support, find numeric far better @ money is. because currency symbol depends on locale can insert $100, change locale , have show 100¥ not same amount barring massive economic shakeup.

i financial accounting software. made decision stick numeric , have been happy it.


Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -