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: [PATCHES] Fixes for MONEY type using locale

2007-11-24 Thread D'Arcy J.M. Cain
On Sat, 24 Nov 2007 11:27:38 -0500 (EST) Bruce Momjian <[EMAIL PROTECTED]> wrote: > And second, why are there no regression tests for MONEY. I see it used > only once in the rules test. I will be committing some regression tests as soon as I finish testing. -- D'Arcy J.M. Cain <[EMAIL PROTECTED

Re: [PATCHES] Fixes for MONEY type using locale

2007-11-24 Thread D'Arcy J.M. Cain
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: cannot cast type bigint to money >

Re: [PATCHES] Fixes for MONEY type using locale

2007-11-24 Thread Bruce Momjian
D'Arcy J.M. Cain wrote: > On Fri, 23 Nov 2007 15:59:29 -0500 (EST) > Bruce Momjian <[EMAIL PROTECTED]> wrote: > > I also removed a ssymbol test because ssymbol will never be \0 based on > > the code. Also, what does this do: > > > > if (buf[LAST_DIGIT] == ',') > > buf[LAST_DIGIT]

Re: [PATCHES] Fixes for MONEY type using locale

2007-11-24 Thread Bruce Momjian
Patch applied. I will email on this LAST_DIGIT issue separately. --- Bruce Momjian wrote: > In looking at the use of the thousands separator in formatting.c and > psql/print.c, I now see similar problems with the MONEY type

Re: [PATCHES] Fixes for MONEY type using locale

2007-11-24 Thread D'Arcy J.M. Cain
On Fri, 23 Nov 2007 15:59:29 -0500 (EST) Bruce Momjian <[EMAIL PROTECTED]> wrote: > I also removed a ssymbol test because ssymbol will never be \0 based on > the code. Also, what does this do: > > if (buf[LAST_DIGIT] == ',') > buf[LAST_DIGIT] = buf[LAST_PAREN]; Good question.

[PATCHES] Fixes for MONEY type using locale

2007-11-23 Thread Bruce Momjian
In looking at the use of the thousands separator in formatting.c and psql/print.c, I now see similar problems with the MONEY type, namely that if the thousands separator is "" it is set to "," even if the decimal separator is ",". The attached patch fixes this. I also removed a ssymbol test becau