public inbox for [email protected]  
help / color / mirror / Atom feed
Dealing with multiple currencies with the money type?
3+ messages / 2 participants
[nested] [flat]

* Dealing with multiple currencies with the money type?
@ 2021-04-18 12:08 Simon Connah <[email protected]>
  2021-04-18 15:21 ` Re: Dealing with multiple currencies with the money type? David G. Johnston <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Simon Connah @ 2021-04-18 12:08 UTC (permalink / raw)
  To: [email protected] <[email protected]>

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?

Simon.

Attachments:

  [application/pgp-signature] signature.asc (249B, ../../H6NwMbpHX0JnUKV8NN9e4CYJ3sT2zUGB5MJP9zXWSvnBh1J6VBRjxvGng2hBSM4iqknyr5p-jPBqoPOq_cOzoidn5gHKz4s9F-o1f1eGZdI=@protonmail.com/2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Dealing with multiple currencies with the money type?
  2021-04-18 12:08 Dealing with multiple currencies with the money type? Simon Connah <[email protected]>
@ 2021-04-18 15:21 ` David G. Johnston <[email protected]>
  2021-04-18 19:07   ` Re: Dealing with multiple currencies with the money type? Simon Connah <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: David G. Johnston @ 2021-04-18 15:21 UTC (permalink / raw)
  To: Simon Connah <[email protected]>; +Cc: [email protected] <[email protected]>

On Sunday, April 18, 2021, Simon Connah <[email protected]>
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.


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Dealing with multiple currencies with the money type?
  2021-04-18 12:08 Dealing with multiple currencies with the money type? Simon Connah <[email protected]>
  2021-04-18 15:21 ` Re: Dealing with multiple currencies with the money type? David G. Johnston <[email protected]>
@ 2021-04-18 19:07   ` Simon Connah <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Simon Connah @ 2021-04-18 19:07 UTC (permalink / raw)
  To: David G. Johnston <[email protected]>; +Cc: [email protected] <[email protected]>

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Sunday, April 18th, 2021 at 16:21, David G. Johnston <[email protected]> wrote:

> On Sunday, April 18, 2021, Simon Connah <[email protected]> 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.

Thank you.

OK I'll use numeric in that case.

Simon.

Attachments:

  [application/pgp-signature] signature.asc (249B, ../../N2WLSjv6ynDZ36XnsCN8BxorUorgtXYSeDL7cNvVWXAS0ohKG3T3TYZXUW97Ds9bRZolw0UPl6mkenmUUs_Yw-c03kz24tvp86vdLD5iihw=@protonmail.com/3-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-04-18 19:07 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-04-18 12:08 Dealing with multiple currencies with the money type? Simon Connah <[email protected]>
2021-04-18 15:21 ` David G. Johnston <[email protected]>
2021-04-18 19:07   ` Simon Connah <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox