Re: [HACKERS] [PATCHES] Fixes for MONEY type using locale

2007-11-26 Thread Peter Eisentraut
Tom Lane wrote: > Aside from the semantic-gap issue, there is the point that providing > a cast might actually mask application errors.  I can well imagine > cases where one of the reasons for using MONEY is *exactly* that it's > not a plain number or easily convertible to one. I'm always against

Re: [HACKERS] [PATCHES] Fixes for MONEY type using locale

2007-11-26 Thread Bruce Momjian
Joshua D. Drake wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On Mon, 26 Nov 2007 23:47:04 -0500 (EST) > Bruce Momjian <[EMAIL PROTECTED]> wrote: > > > Perhaps all we need is a way to accomplish the casting so it isn't > > automatic. This works: > > > > test=> SELECT regexp_r

Re: [HACKERS] [PATCHES] Fixes for MONEY type using locale

2007-11-26 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, 26 Nov 2007 23:47:04 -0500 (EST) Bruce Momjian <[EMAIL PROTECTED]> wrote: > Perhaps all we need is a way to accomplish the casting so it isn't > automatic. This works: > > test=> SELECT regexp_replace('2343'::money::text, '[^$,]*', > '

Re: [HACKERS] [PATCHES] Fixes for MONEY type using locale

2007-11-26 Thread Bruce Momjian
Tom Lane wrote: > "Joshua D. Drake" <[EMAIL PROTECTED]> writes: > > Well if we are going to continue to support money (which I am against) > > we should support the casting to numeric as that is by far a more > > common implementation of money and we will have mixed environments. > > So, you don't

Re: [HACKERS] [PATCHES] Fixes for MONEY type using locale

2007-11-26 Thread Tom Lane
"Joshua D. Drake" <[EMAIL PROTECTED]> writes: > Well if we are going to continue to support money (which I am against) > we should support the casting to numeric as that is by far a more > common implementation of money and we will have mixed environments. So, you don't use MONEY, and you don't wa

Re: [HACKERS] [PATCHES] Fixes for MONEY type using locale

2007-11-26 Thread Joshua D. Drake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Mon, 26 Nov 2007 21:19:48 -0500 Tom Lane <[EMAIL PROTECTED]> wrote: > Bruce Momjian <[EMAIL PROTECTED]> writes: > > Added to TODO list: > > * Allow MONEY to be cast to/from other numeric data types > > So in other words, that's been added

Re: [HACKERS] [PATCHES] Fixes for MONEY type using locale

2007-11-26 Thread Tom Lane
Bruce Momjian <[EMAIL PROTECTED]> writes: > Added to TODO list: > * Allow MONEY to be cast to/from other numeric data types So in other words, that's been added to the TODO list *purely* on your own say-so, and not because any users asked for it or anyone else thinks it's a good idea. Sin

Re: [HACKERS] [PATCHES] Fixes for MONEY type using locale

2007-11-26 Thread Bruce Momjian
Bruce Momjian wrote: > D'Arcy J.M. Cain wrote: > > On Sat, 24 Nov 2007 11:27:38 -0500 (EST) > > Bruce Momjian <[EMAIL PROTECTED]> wrote: > > > I am confused about two other items with MONEY. First, why can't > > > anything but a string be cast to this type? > > > > > > test=> select 87123487231

Re: [HACKERS] [PATCHES] Fixes for MONEY type using locale

2007-11-24 Thread Bruce Momjian
D'Arcy J.M. Cain wrote: > On Sat, 24 Nov 2007 11:27:38 -0500 (EST) > Bruce Momjian <[EMAIL PROTECTED]> wrote: > > I am confused about two other items with MONEY. First, why can't > > anything but a string be cast to this type? > > > > test=> select 871234872319489323::money; > > ERROR: c