Re: dividing money by money

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: dividing money by money
Дата
Msg-id 15804.1279291396@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: dividing money by money  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Ответы Re: dividing money by money  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> * The cast functions were marked immutable, which is wrong because
>> they depend on the setting of lc_monetary.  The right marking is
>> "stable".
> Is there any impact of the change to lc_monetary which would matter
> besides the number of decimal positions?  If that changes, isn't
> every money amount in the database instantly made incorrect?

Yeah, which is why I didn't feel that this was something that really
needed back-patching, even though the markings have been wrong since
the lc_monetary dependency was introduced.

> If so,
> I'm dubious that marking this as stable is worthwhile -- if someone
> is making a change like that, they will need to update all money
> amounts in the database; reindexing would be the least of their
> problems.  Or am I missing some other effect?

Well, whether people change the value in practice or not, it's still
wrong to mark the functions more optimistically than the rules say.
The only way I'd be willing to label those things immutable was if we
did something to lock down lc_monetary for the life of a database (ie,
make it work more like lc_collate does now).  Which might be a good
idea, but it's not how it works today.
        regards, tom lane


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

Предыдущее
От: Thom Brown
Дата:
Сообщение: psql auto-completion for multiple where clauses
Следующее
От: "Greg Sabino Mullane"
Дата:
Сообщение: Re: psql auto-completion for multiple where clauses