Re: [HACKERS] Re: [QUESTIONS] money or dollar type
От | Thomas G. Lockhart |
---|---|
Тема | Re: [HACKERS] Re: [QUESTIONS] money or dollar type |
Дата | |
Msg-id | 3557DB77.BC72C128@alumni.caltech.edu обсуждение исходный текст |
Ответ на | Re: [HACKERS] Re: [QUESTIONS] money or dollar type (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: [HACKERS] Re: [QUESTIONS] money or dollar type
|
Список | pgsql-hackers |
> However, what money *really* needs is more precision. Has there been > any thought of working on the full SQL exact-numeric package? Yes. The problem is that afaik there is no variable-width exact numeric package available. BCD arithmetic could work if a package were available. The GNU extended precision package looks interesting, but we would have to translate from a string to internal format for every operation, or somehow store the internal representation in each tuple which seems messy. I'm thinking of moving the 64-bit integer contrib package I wrote into the native backend as a foundation for the numeric/decimal data types. We would need to get feedback from more of the supported platforms on how to do 64-bit integers (a few processors have them as a "long" type, and the GNU 32-bit compilers seem to allow a "long long" declaration, but I don't know what other systems do for this). The only other thing which would need to be handled is how to pass along the two value precision/scale parameters which are a part of the declaration for these types. I've just finished working on the type conversion algorithms so understand the current "atttypmod" field a bit better, but have not decided how to extend it to multiple fields. - Tom
В списке pgsql-hackers по дате отправления: