Re: [HACKERS] monetary bug

2004-08-23 Thread Oliver Elphick
On Mon, 2004-08-23 at 14:11, Mike Mascari wrote: ... > MONEY seems "odd" because it is interpreting its internal > representation based upon locale and the locale is also determining > its possible representation, so one database's MONEY isn't really > the same type as another database's MONEY.

Re: [HACKERS] monetary bug

2004-08-23 Thread Karel Zak
On Mon, Aug 23, 2004 at 02:52:44PM +0200, Dennis Bjorklund wrote: > On Mon, 23 Aug 2004, Karel Zak wrote: > > > I think it's pretty extendable solution in contrast to the current > > hardcoded in/out datetypes functions. > > Who are we formatting for? If the client wants the data in a s

Re: [HACKERS] monetary bug

2004-08-23 Thread Mike Mascari
Dennis Bjorklund wrote: On Sun, 22 Aug 2004, Peter Eisentraut wrote: To me, this seems completely wrong-headed. Data types should be defined by what operations you can do on them, not by what output format they have. I totally agree, lets get rid of money all together. If not, what makes money s

Re: [HACKERS] monetary bug

2004-08-23 Thread Dennis Bjorklund
On Mon, 23 Aug 2004, Karel Zak wrote: > I think it's pretty extendable solution in contrast to the current > hardcoded in/out datetypes functions. Who are we formatting for? If the client wants the data in a specific format then they can do SELECT to_char(...), or do the formatting in t

Re: [HACKERS] monetary bug

2004-08-23 Thread Karel Zak
On Sun, Aug 22, 2004 at 04:07:17PM -0400, Tom Lane wrote: > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > Tom Lane wrote: > >> We keep hoping someone will step up to the plate and rewrite it, > >> instead. Per previous discussion, the type really ought to be a thin > >> layer over "numeric", wit

Re: [HACKERS] monetary bug

2004-08-22 Thread Dennis Bjorklund
On Sun, 22 Aug 2004, Peter Eisentraut wrote: > To me, this seems completely wrong-headed. Data types should be defined > by what operations you can do on them, not by what output format they > have. I totally agree, lets get rid of money all together. If not, what makes money so special? Do w

Re: [HACKERS] monetary bug

2004-08-22 Thread Greg Stark
Tom Lane <[EMAIL PROTECTED]> writes: > Oliver Elphick <[EMAIL PROTECTED]> writes: > > It seems to me a monetary type is a complex type consisting of currency > > code and amount -- but you couldn't sum mixed currencies. Or else it is > > limited to the currency of the locale, which doesn't seem

Re: [HACKERS] monetary bug

2004-08-22 Thread Hannu Krosing
On P, 2004-08-22 at 23:07, Tom Lane wrote: > Peter Eisentraut <[EMAIL PROTECTED]> writes: > > Tom Lane wrote: > >> We keep hoping someone will step up to the plate and rewrite it, > >> instead. Per previous discussion, the type really ought to be a thin > >> layer over "numeric", with most likely n

Re: [HACKERS] monetary bug

2004-08-22 Thread D'Arcy J.M. Cain
On Sun, 22 Aug 2004 13:29:14 -0400 Tom Lane <[EMAIL PROTECTED]> wrote: > Are you aware that the monetary type is deprecated and is going to be > dropped entirely pretty soon? I would not recommend that you spend > any time on it, unless you want to commit to doing a wholesale > rewrite. Store your

Re: [HACKERS] monetary bug

2004-08-22 Thread Peter Eisentraut
Tom Lane wrote: > The idea behind the money type is to format per the lc_monetary > locale setting, which seems perfectly reasonable to me. To me, this seems completely wrong-headed. Data types should be defined by what operations you can do on them, not by what output format they have. With t

Re: [HACKERS] monetary bug

2004-08-22 Thread Tom Lane
Oliver Elphick <[EMAIL PROTECTED]> writes: > It seems to me a monetary type is a complex type consisting of currency > code and amount -- but you couldn't sum mixed currencies. Or else it is > limited to the currency of the locale, which doesn't seem particularly > useful. In a former lifetime I

Re: [HACKERS] monetary bug

2004-08-22 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> We keep hoping someone will step up to the plate and rewrite it, >> instead. Per previous discussion, the type really ought to be a thin >> layer over "numeric", with most likely no operations of its own >> except I/O conversion. >

Re: [HACKERS] monetary bug

2004-08-22 Thread Oliver Elphick
On Sun, 2004-08-22 at 20:40, Tom Lane wrote: > Mike Mascari <[EMAIL PROTECTED]> writes: > > Tom Lane wrote: > >> Are you aware that the monetary type is deprecated and is going to be > >> dropped entirely pretty soon? > > > What's taking so long? ;-) > > We keep hoping someone will step up to the

Re: [HACKERS] monetary bug

2004-08-22 Thread Peter Eisentraut
Tom Lane wrote: > We keep hoping someone will step up to the plate and rewrite it, > instead. Per previous discussion, the type really ought to be a thin > layer over "numeric", with most likely no operations of its own > except I/O conversion. And what would it do with it? Add a currency symbol?

Re: [HACKERS] monetary bug

2004-08-22 Thread Tom Lane
Mike Mascari <[EMAIL PROTECTED]> writes: > Tom Lane wrote: >> Are you aware that the monetary type is deprecated and is going to be >> dropped entirely pretty soon? > What's taking so long? ;-) We keep hoping someone will step up to the plate and rewrite it, instead. Per previous discussion, the

Re: [HACKERS] monetary bug

2004-08-22 Thread Mike Mascari
Tom Lane wrote: Mahmoud Taghizadeh <[EMAIL PROTECTED]> writes: a dirty method to fix this bug is to replace following Are you aware that the monetary type is deprecated and is going to be dropped entirely pretty soon? What's taking so long? ;-) Mike Mascari ---(end of broad

Re: [HACKERS] monetary bug

2004-08-22 Thread Tom Lane
Mahmoud Taghizadeh <[EMAIL PROTECTED]> writes: > a dirty method to fix this bug is to replace following > line > if (isdigit((unsigned char) *s) && dec < fpoint ) > with > if (isdigit((unsigned char) *s) && ((dec < fpoint) || > fpoint == 0)) This patch is wrong. Something involving "!seen_dot |

[HACKERS] monetary bug

2004-08-22 Thread Mahmoud Taghizadeh
I found a little bug in monetary function of postgresql function cash_in in file cash.c the problem is that when I run set lc_monetary to "fa_IR.UTF8" and try to insert a value to a field with type of money, I got the following error: "invalid input syntax for type money: "1000" at the same time