You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to know what the motivation behind storing the numeric amount in postgres composite types as a numeric(20,8) is. With this setup, storing "USD 10.00" for example, turns into "USD 10.00000000" in the db, and then when retrieving it, it retains the precision.
I wanted more control over how much precision is stored for certain columns. I changed the composite money type from what the readme mentions:
CREATETYPEpublic.money_with_currency AS (currency_code char(3), amount numeric(20,8))
To this:
CREATETYPEpublic.money_with_currency_new AS (currency char(3), amount numeric)
It works much better for my use cases. Is there any reason why this shouldn't be the default?