Re: Dealing with multiple currencies with the money type? - Mailing list pgsql-novice

From David G. Johnston
Subject Re: Dealing with multiple currencies with the money type?
Date
Msg-id CAKFQuwZx8MvgnG=eXQgfLh0kuSqeUrMRVE5JLvDy3rVqb1A_xQ@mail.gmail.com
Whole thread Raw
In response to Dealing with multiple currencies with the money type?  (Simon Connah <simon.n.connah@protonmail.com>)
Responses Re: Dealing with multiple currencies with the money type?  (Simon Connah <simon.n.connah@protonmail.com>)
List pgsql-novice
On Sunday, April 18, 2021, Simon Connah <simon.n.connah@protonmail.com> wrote:
Hi,

I've read this page:

https://www.postgresql.org/docs/13/datatype-money.html

which seems to suggest that lc_monetary dictates what currency the database uses for the money type. But what if you want to have transactions in USD, GBP and EUR from a database with en_GB.UTF8 locale?

Is this possible?


The money type should largely be avoided.  I find it useful for parsing external data but in the end store money using numeric.  Add a currency type field if you need to be explixit about what units the currency is in.

David J.

pgsql-novice by date:

Previous
From: Simon Connah
Date:
Subject: Dealing with multiple currencies with the money type?
Next
From: Simon Connah
Date:
Subject: Re: Dealing with multiple currencies with the money type?