Re: [HACKERS] money data type and conversions]

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] money data type and conversions]
Дата
Msg-id 22016.930179033@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [HACKERS] money data type and conversions]  (Bruce Momjian <maillist@candle.pha.pa.us>)
Ответы Re: [HACKERS] money data type and conversions]  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <maillist@candle.pha.pa.us> writes:
> Maybe we will have to add '$' symbols to a special case of the numeric
> type, or add a function to output numeric in money format?

I like the last idea (add a formatting function), because it's simple,
self-contained, and doesn't force any solutions on anyone.  Don't want
any decoration on your number?  Just read it out.  Don't like the
decoration added by the formatting function?  Write your own function.
No table reconstruction required.  With a data-type-driven approach,
changing your mind is painful because you have to rebuild your tables.

We'd probably also want an inverse function that would strip off the
decoration and produce a numeric, but that's easy too...
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kristofer Munn
Дата:
Сообщение: Perl 5 Interface on 6.5 and lo_creat/lo_open problem
Следующее
От: Don Baccus
Дата:
Сообщение: Re: [HACKERS] The dangers of "-F"