Re: dividing money by money - Mailing list pgsql-hackers

From Tom Lane
Subject Re: dividing money by money
Date
Msg-id 15804.1279291396@sss.pgh.pa.us
Whole thread Raw
In response to Re: dividing money by money  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: dividing money by money
List 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 by date:

Previous
From: Thom Brown
Date:
Subject: psql auto-completion for multiple where clauses
Next
From: "Greg Sabino Mullane"
Date:
Subject: Re: psql auto-completion for multiple where clauses