Re: Money data type - Deprecated?

Lists: pgsql-general
From: Kless <jonas(dot)esp(at)googlemail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Money data type - Deprecated?
Date: 2008-05-26 08:38:49
Message-ID: 03960805-dea4-46b6-a2a5-82ce69748f31@m45g2000hsb.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Does the money data type is deprecated?

That says in 8.2 docs [1]. But I'm not sure why that notice doesn't
appear in the 8.3 docs [2] .

[1] http://www.postgresql.org/docs/8.2/static/datatype-money.html
[2] http://www.postgresql.org/docs/8.3/static/datatype-money.html


From: Justin <justin(at)emproshunts(dot)com>
To: Kless <jonas(dot)esp(at)googlemail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Money data type - Deprecated?
Date: 2008-05-26 19:46:39
Message-ID: 483B139F.3040400@emproshunts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Thats a good Question is the Money type ever going to die i believe it
was deprecated several versions ago?

I use the money type a formatting step in select statements when
displaying data on the client only. It saves me setting up input mask
and what not on client side.

There are draw backs to using the money type
dumps/restores can go wrong
many frameworks convert money data type back to numeric or cast it
to String type

I would never have and never will use money as a data type in tables as
the precision is fixed to 2

Kless wrote:
> Does the money data type is deprecated?
>
> That says in 8.2 docs [1]. But I'm not sure why that notice doesn't
> appear in the 8.3 docs [2] .
>
>
> [1] http://www.postgresql.org/docs/8.2/static/datatype-money.html
> [2] http://www.postgresql.org/docs/8.3/static/datatype-money.html
>
>


From: Andrew Sullivan <ajs(at)commandprompt(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Money data type - Deprecated?
Date: 2008-05-26 20:05:09
Message-ID: 20080526200508.GO21327@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Mon, May 26, 2008 at 03:46:39PM -0400, Justin wrote:
> Thats a good Question is the Money type ever going to die i believe it was
> deprecated several versions ago?

I think it was undeprecated in 8.3 because someone (D'Arcy J.M. Cain?)
made a bunch of changes to the datatype to make it more
currency-portable. Have a look in the release notes.

A

--
Andrew Sullivan
ajs(at)commandprompt(dot)com
+1 503 667 4564 x104
http://www.commandprompt.com/


From: Justin <justin(at)emproshunts(dot)com>
To: Andrew Sullivan <ajs(at)commandprompt(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Money data type - Deprecated?
Date: 2008-05-26 20:29:35
Message-ID: 483B1DAF.6010401@emproshunts.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

Andrew Sullivan wrote:
> On Mon, May 26, 2008 at 03:46:39PM -0400, Justin wrote:
>
>> Thats a good Question is the Money type ever going to die i believe it was
>> deprecated several versions ago?
>>
>
> I think it was undeprecated in 8.3 because someone (D'Arcy J.M. Cain?)
> made a bunch of changes to the datatype to make it more
> currency-portable. Have a look in the release notes.
>
> A
>
>
I did it don't say that much

*

Widen the MONEY data type to 64 bits (D'Arcy Cain)

This greatly increases the range of supported MONEY values.

http://developer.postgresql.org/pgdocs/postgres/release-8-3.html

Is there somewhere else i'm suppose to look? I'm glade its been saved.

it could use more improvements like ability to
1.change precision,
2.change output format.


From: Andrew Sullivan <ajs(at)commandprompt(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Money data type - Deprecated?
Date: 2008-05-26 21:23:55
Message-ID: 20080526212355.GY21327@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Mon, May 26, 2008 at 04:29:35PM -0400, Justin wrote:

> Is there somewhere else i'm suppose to look? I'm glade its been saved.
> it could use more improvements like ability to
> 1.change precision,
> 2.change output format.

I think if you want those improvements, you'll need to convince some
people on -hackers.

A

--
Andrew Sullivan
ajs(at)commandprompt(dot)com
+1 503 667 4564 x104
http://www.commandprompt.com/


From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Andrew Sullivan" <ajs(at)commandprompt(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Money data type - Deprecated?
Date: 2008-05-27 13:29:47
Message-ID: b42b73150805270629h309f3704i72c259081d8d393d@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Mon, May 26, 2008 at 4:05 PM, Andrew Sullivan <ajs(at)commandprompt(dot)com> wrote:
> On Mon, May 26, 2008 at 03:46:39PM -0400, Justin wrote:
>> Thats a good Question is the Money type ever going to die i believe it was
>> deprecated several versions ago?
>
> I think it was undeprecated in 8.3 because someone (D'Arcy J.M. Cain?)
> made a bunch of changes to the datatype to make it more
> currency-portable. Have a look in the release notes.

Your summary is pretty much correct. The 'deprecated' moniker was for
all intents and purposes removed when the range was expanded. For the
record, I don't agree with this...IMO the money type is not really
rigorous enough to be useful. It's missing tons of basic casts and is
just plain weird. OTOH, it's a neat example of a fixed precision
integer type.

I personally think that it really belongs in contrib as an example of
adding a new type...with all the money bits stripped off, as a
strictly fixed precision integer.

merlin


From: Decibel! <decibel(at)decibel(dot)org>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: "Andrew Sullivan" <ajs(at)commandprompt(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Money data type - Deprecated?
Date: 2008-06-16 16:10:09
Message-ID: 23DCE1CF-FFAF-4962-842E-1B91D0B6D5E6@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On May 27, 2008, at 8:29 AM, Merlin Moncure wrote:
> On Mon, May 26, 2008 at 4:05 PM, Andrew Sullivan
> <ajs(at)commandprompt(dot)com> wrote:
>> On Mon, May 26, 2008 at 03:46:39PM -0400, Justin wrote:
>>> Thats a good Question is the Money type ever going to die i
>>> believe it was
>>> deprecated several versions ago?
>>
>> I think it was undeprecated in 8.3 because someone (D'Arcy J.M.
>> Cain?)
>> made a bunch of changes to the datatype to make it more
>> currency-portable. Have a look in the release notes.
>
> Your summary is pretty much correct. The 'deprecated' moniker was for
> all intents and purposes removed when the range was expanded. For the
> record, I don't agree with this...IMO the money type is not really
> rigorous enough to be useful. It's missing tons of basic casts and is
> just plain weird. OTOH, it's a neat example of a fixed precision
> integer type.
>
> I personally think that it really belongs in contrib as an example of
> adding a new type...with all the money bits stripped off, as a
> strictly fixed precision integer.

I think what it really needs is currency information so that you can
tell if a value is in USD or something else. But it seems that every
time that's brought up, people want to start worrying about storing
conversion tables.
--
Decibel!, aka Jim C. Nasby, Database Architect decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828


From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Decibel! <decibel(at)decibel(dot)org>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, Andrew Sullivan <ajs(at)commandprompt(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Money data type - Deprecated?
Date: 2008-06-16 21:07:53
Message-ID: 20080616210753.GI4792@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-general

On Mon, Jun 16, 2008 at 11:10:09AM -0500, Decibel! wrote:
> >I personally think that it really belongs in contrib as an example of
> >adding a new type...with all the money bits stripped off, as a
> >strictly fixed precision integer.
>
> I think what it really needs is currency information so that you can
> tell if a value is in USD or something else. But it seems that every
> time that's brought up, people want to start worrying about storing
> conversion tables.

So? Tagged types has a currency type. As long as you provide a way to
extract which currency is meant, people can join on conversion tables.

Now that I think of it, enum's have the necessary machinary already to
map OIDs to strings so you're nearly all the way there... (Except
ofcourse taggedtypes didn't prevent you from adding more currencies
later, which enums don't currently allow you to do).

Have a nice day,
--
Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/
> Please line up in a tree and maintain the heap invariant while
> boarding. Thank you for flying nlogn airlines.