Re: inhibit rounding on numeric columns
От | Scott Marlowe |
---|---|
Тема | Re: inhibit rounding on numeric columns |
Дата | |
Msg-id | dcc563d10802142342m2f22721dtf6c109326908bd3d@mail.gmail.com обсуждение исходный текст |
Ответ на | inhibit rounding on numeric columns ("Horst Dehmer" <horst.dehmer@inode.at>) |
Список | pgsql-sql |
On Fri, Feb 15, 2008 at 1:28 AM, Horst Dehmer <horst.dehmer@inode.at> wrote: > > > Hi! > > Is there an easy way to enforce strict handling of numeric values with > scales, i.e. raise an exception/error instead of rounding values to the > specified scale? I can't think of an easy way. But you can always make your own type I guess. > Sadly, changing the schema is hardly a possibility for me :-( Sadly, the people who have burdened you with this problem don't seem to have fully understood the implications of rounding and the SQL specification's take on when it happens. Can you not even just make it wider? I mean, pgsql can change types on the fly, and since the value's will fit in newer, wider numerics, then you have an easy solution. Anything else you do is going to far more invasive than changing the schema. Or you'll have to handle all this in code somewhere.
В списке pgsql-sql по дате отправления: