Re: About the MONEY type

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: About the MONEY type
Date: 2016-11-30 13:43:22
Message-ID: 12fae084-95d5-6616-7553-e03e24aab772@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 30/11/16 12:05, Thomas Kellerer wrote:
> Tobia Conforto schrieb am 30.11.2016 um 12:15:
>> I think MONEY is a great datatype, at least in theory.
>
> I personally find it pretty useless to be honest - especially because
> the currency symbol depends on the client.
>
> So if I store a money value in the database, some clients see CHF,
> some see Kč, some see £ and others might see € - all see the same
> amount. Which seems totally wrong because 10€ is something completely
> different then 10Kč or 10£.
>
> Plus: inside a programming language (e.g. Java/JDBC) it's hard to
> work with the values because the database sends the values as a
> string (it has to because of the currency symbol) but in reality it
> is a number - but you can't just convert the String to a number again
> because of the symbol.
>
> So I always recommend to not use it (in Postgres just as well as in
> other DBMS, e.g. SQL Server)

I seem to remember that it was actually deprecated at some point - this
is going back quite a few years. This was later reversed, though I don't
know why.

Ray.

--
Raymond O'Donnell :: Galway :: Ireland
rod(at)iol(dot)ie

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Howard News 2016-11-30 13:53:21 Re: Verify Option with pg_dump
Previous Message Timoteo Blanco 2016-11-30 13:42:20 select function alias