Re: [HACKERS] Re: [QUESTIONS] money or dollar type - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Re: [QUESTIONS] money or dollar type
Date
Msg-id 199805131806.OAA23263@candle.pha.pa.us
Whole thread Raw
In response to Re: [HACKERS] Re: [QUESTIONS] money or dollar type  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
>
> Bruce Momjian <maillist@candle.pha.pa.us> writes:
> > I have thought about this.  Just bitmask the 16-bits to two 8-bit
> > quantities.  Give you max 256 length with 256 currencies.
>
> Uh, no: what we were discussing was the total width and decimal place
> position of exact numerics.  Probably, 255 numeric digits are enough
> for practical purposes, so I don't feel an urgent need to make atttypmod
> wider for this.  But if you want to make it 32 bits, that would
> eliminate any concern --- we'd have room for 64k-digit numerics...
>
> If we're going to associate currencies with the money datatype, the
> currency needs to be part of the data, not part of the column type.
> I need to be able to store amounts of different currencies in the same
> column.  (Otherwise, a transaction log would need a separate column for
> every possible currency, all but one of which would be null in any given
> row.  Ick.)

Yep, good point.

--
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] mmap and MAP_ANON
Next
From: ocie@paracel.com
Date:
Subject: Re: [HACKERS] mmap and MAP_ANON