From: Scott Marlowe <scott.marlowe@gmail.com>
To: Horst Dehmer <horst.dehmer@inode.at>
Cc: pgsql-sql@postgresql.org
Subject: Re: inhibit rounding on numeric columns
Date: Fri, 15 Feb 2008 01:42:29 -0600
Message-ID: <dcc563d10802142342m2f22721dtf6c109326908bd3d@mail.gmail.com> (raw)
In-Reply-To: <E1JPuyj-0007vC-6J@smartmx-12.inode.at>
References: <E1JPuyj-0007vC-6J@smartmx-12.inode.at>
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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: scott.marlowe@gmail.com, horst.dehmer@inode.at
Subject: Re: inhibit rounding on numeric columns
In-Reply-To: <dcc563d10802142342m2f22721dtf6c109326908bd3d@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox