pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedFunction for adding Money type
7+ messages / 6 participants
[nested] [flat]
* Function for adding Money type
@ 2003-01-24 23:41 David Durst <ddurst@larubber.com>
2003-01-25 00:17 ` Re: Function for adding Money type Josh Berkus <josh@agliodbs.com>
0 siblings, 1 reply; 7+ messages in thread
From: David Durst @ 2003-01-24 23:41 UTC (permalink / raw)
To: pgsql-sql
Are there functions for adding and subtracting this type from itself?
Or is there a simple way to do it?
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Function for adding Money type
2003-01-24 23:41 Function for adding Money type David Durst <ddurst@larubber.com>
@ 2003-01-25 00:17 ` Josh Berkus <josh@agliodbs.com>
2003-01-25 01:30 ` Re: Function for adding Money type David Durst <ddurst@larubber.com>
2003-01-26 13:53 ` Re: [SQL] Function for adding Money type D'Arcy J.M. Cain <darcy@druid.net>
0 siblings, 2 replies; 7+ messages in thread
From: Josh Berkus @ 2003-01-25 00:17 UTC (permalink / raw)
To: pgsql-sql
David,
> Are there functions for adding and subtracting this type from itself?
> Or is there a simple way to do it?
The MONEY type is depreciated, and should have been removed from the Postgres
source but was missed as an oversight. Use NUMERIC instead.
--
-Josh Berkus
Aglio Database Solutions
San Francisco
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Function for adding Money type
2003-01-24 23:41 Function for adding Money type David Durst <ddurst@larubber.com>
2003-01-25 00:17 ` Re: Function for adding Money type Josh Berkus <josh@agliodbs.com>
@ 2003-01-25 01:30 ` David Durst <ddurst@larubber.com>
1 sibling, 0 replies; 7+ messages in thread
From: David Durst @ 2003-01-25 01:30 UTC (permalink / raw)
To: josh@agliodbs.com; +Cc: pgsql-sql
> David,
>
>> Are there functions for adding and subtracting this type from itself?
>> Or is there a simple way to do it?
>
> The MONEY type is depreciated, and should have been removed from the
> Postgres source but was missed as an oversight. Use NUMERIC instead.
>
> --
> -Josh Berkus
> Aglio Database Solutions
> San Francisco
Already done, I found it in another doc.
Thanks though
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [SQL] Function for adding Money type
2003-01-24 23:41 Function for adding Money type David Durst <ddurst@larubber.com>
2003-01-25 00:17 ` Re: Function for adding Money type Josh Berkus <josh@agliodbs.com>
@ 2003-01-26 13:53 ` D'Arcy J.M. Cain <darcy@druid.net>
2003-01-26 13:48 ` Re: [SQL] Function for adding Money type Thomas Good <tomg@sqlclinic.net>
2003-01-26 16:03 ` Re: [SQL] Function for adding Money type Oliver Elphick <olly@lfix.co.uk>
1 sibling, 2 replies; 7+ messages in thread
From: D'Arcy J.M. Cain @ 2003-01-26 13:53 UTC (permalink / raw)
To: pgsql-sql; +Cc: pgsql-hackers@postgreSQL.org
On Friday 24 January 2003 19:17, Josh Berkus wrote:
> The MONEY type is depreciated, and should have been removed from the
> Postgres source but was missed as an oversight. Use NUMERIC instead.
Note that not all of us agree. I had to change all of our fields from MONEY
to NUMERIC recently because of the lack of support for MONEY but I would
prefer to see it improved instead. Now that we have changed we find that we
need to create a new table for balances driven by a trigger because
calculating balances just went up in cost with that change. The reason is
simply that MONEY used nothing but integer arithmetic and NUMERIC has to do a
lot more processing in code.
This year, my team is planning on improving the MONEY type. Of course, we can
always make it a user defined type if PostgreSQL doesn't want it. We will at
least put it into contrib. However, if people think that it is useful and
want to leave it in the main tree that's good too. What we want to do is a)
switch to a 64 bit integer from a 32 bit integer in order to hold amounts of
any reasonabe size and b) allow it to be cast to and from more types.
Perhaps we can also add the ability to specify the number of decimal places
on output but I am not sure if that would affect the primary benefit of using
it, speed.
--
D'Arcy J.M. Cain <darcy@{druid|vex}.net> | Democracy is three wolves
http://www.druid.net/darcy/ | and a sheep voting on
+1 416 425 1212 (DoD#0082) (eNTP) | what's for dinner.
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [SQL] Function for adding Money type
2003-01-24 23:41 Function for adding Money type David Durst <ddurst@larubber.com>
2003-01-25 00:17 ` Re: Function for adding Money type Josh Berkus <josh@agliodbs.com>
2003-01-26 13:53 ` Re: [SQL] Function for adding Money type D'Arcy J.M. Cain <darcy@druid.net>
@ 2003-01-26 13:48 ` Thomas Good <tomg@sqlclinic.net>
1 sibling, 0 replies; 7+ messages in thread
From: Thomas Good @ 2003-01-26 13:48 UTC (permalink / raw)
To: pgsql-hackers@postgreSQL.org; +Cc: pgsql-sql
On Sun, 26 Jan 2003, D'Arcy J.M. Cain wrote:
> This year, my team is planning on improving the MONEY type. Of course, we can
> always make it a user defined type if PostgreSQL doesn't want it. We will at
> least put it into contrib. However, if people think that it is useful and
> want to leave it in the main tree that's good too. What we want to do is a)
> switch to a 64 bit integer from a 32 bit integer in order to hold amounts of
> any reasonabe size and b) allow it to be cast to and from more types.
> Perhaps we can also add the ability to specify the number of decimal places
> on output but I am not sure if that would affect the primary benefit of using
> it, speed.
Hey good news D'Arcy! I prefer using MONEY as well.
-----------------------------------------------------------------------
Thomas Good e-mail: tomg@sqlclinic.net
Programmer/Analyst phone: (+1) 718.818.5528
Residential Services fax: (+1) 718.818.5056
Behavioral Health Services, SVCMC-NY mobile: (+1) 917.282.7359
-- Geistiges Eigentum ist Diebstahl! --
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [SQL] Function for adding Money type
2003-01-24 23:41 Function for adding Money type David Durst <ddurst@larubber.com>
2003-01-25 00:17 ` Re: Function for adding Money type Josh Berkus <josh@agliodbs.com>
2003-01-26 13:53 ` Re: [SQL] Function for adding Money type D'Arcy J.M. Cain <darcy@druid.net>
@ 2003-01-26 16:03 ` Oliver Elphick <olly@lfix.co.uk>
2003-01-27 20:14 ` Re: [SQL] Function for adding Money type Bruce Momjian <pgman@candle.pha.pa.us>
1 sibling, 1 reply; 7+ messages in thread
From: Oliver Elphick @ 2003-01-26 16:03 UTC (permalink / raw)
To: pgsql-hackers@postgreSQL.org; +Cc: josh@agliodbs.com; ddurst@larubber.com; pgsql-sql
On Sun, 2003-01-26 at 13:53, D'Arcy J.M. Cain wrote:
> This year, my team is planning on improving the MONEY type. Of course, we can
> always make it a user defined type if PostgreSQL doesn't want it. We will at
> least put it into contrib. However, if people think that it is useful and
> want to leave it in the main tree that's good too. What we want to do is a)
> switch to a 64 bit integer from a 32 bit integer in order to hold amounts of
> any reasonabe size and b) allow it to be cast to and from more types.
> Perhaps we can also add the ability to specify the number of decimal places
> on output but I am not sure if that would affect the primary benefit of using
> it, speed.
A money type needs to specify what currency is held. The current one
changes the currency with the locale, which makes nonsense of existing
data.
--
Oliver Elphick Oliver.Elphick@lfix.co.uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"Wash me thoroughly from mine iniquity, and cleanse me
from my sin. For I acknowledge my transgressions; and
my sin is ever before me. Against thee, thee only,
have I sinned, and done this evil in thy sight..."
Psalms 51:2-4
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: [SQL] Function for adding Money type
2003-01-24 23:41 Function for adding Money type David Durst <ddurst@larubber.com>
2003-01-25 00:17 ` Re: Function for adding Money type Josh Berkus <josh@agliodbs.com>
2003-01-26 13:53 ` Re: [SQL] Function for adding Money type D'Arcy J.M. Cain <darcy@druid.net>
2003-01-26 16:03 ` Re: [SQL] Function for adding Money type Oliver Elphick <olly@lfix.co.uk>
@ 2003-01-27 20:14 ` Bruce Momjian <pgman@candle.pha.pa.us>
0 siblings, 0 replies; 7+ messages in thread
From: Bruce Momjian @ 2003-01-27 20:14 UTC (permalink / raw)
To: Oliver Elphick <olly@lfix.co.uk>; +Cc: pgsql-hackers@postgresql.org; josh@agliodbs.com; ddurst@larubber.com; pgsql-sql
Oliver Elphick wrote:
> On Sun, 2003-01-26 at 13:53, D'Arcy J.M. Cain wrote:
>
> > This year, my team is planning on improving the MONEY type. Of course, we can
> > always make it a user defined type if PostgreSQL doesn't want it. We will at
> > least put it into contrib. However, if people think that it is useful and
> > want to leave it in the main tree that's good too. What we want to do is a)
> > switch to a 64 bit integer from a 32 bit integer in order to hold amounts of
> > any reasonabe size and b) allow it to be cast to and from more types.
> > Perhaps we can also add the ability to specify the number of decimal places
> > on output but I am not sure if that would affect the primary benefit of using
> > it, speed.
>
> A money type needs to specify what currency is held. The current one
> changes the currency with the locale, which makes nonsense of existing
> data.
Agreed. We can default to locale but need a way of overriding that,
ideally with atttypmod at the column level. I assume this will be done
for 7.4 (you said "this year")?
--
Bruce Momjian | http://candle.pha.pa.us
pgman@candle.pha.pa.us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2003-01-27 20:14 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-01-24 23:41 Function for adding Money type David Durst <ddurst@larubber.com>
2003-01-25 00:17 ` Josh Berkus <josh@agliodbs.com>
2003-01-25 01:30 ` David Durst <ddurst@larubber.com>
2003-01-26 13:53 ` D'Arcy J.M. Cain <darcy@druid.net>
2003-01-26 13:48 ` Thomas Good <tomg@sqlclinic.net>
2003-01-26 16:03 ` Oliver Elphick <olly@lfix.co.uk>
2003-01-27 20:14 ` Bruce Momjian <pgman@candle.pha.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox