Meaning of precision 1, scale 0 in error message?
4
votes
1
answer
4823
views
What datatype does this error message refer to?
> ERROR: numeric field overflow
> DETAIL: A field with precision 1, scale 0 must round to an absolute value less than 10^1.
I'm getting the error listed above, it's coming from an insert trigger. Since none of my datatype are explicitly defined as
NUMERIC(1,0)
and since the maximum value is 10 to the power of 1 (i.e. 10) I'm guessing that this error is actually referring to a BOOLEAN
field. However, I can't find confirmation of this.
UPDATE
Solved. My trigger is attempting to parse some strings into numbers. The error listed is returned when to_number()
doesn't get a string in the expected format.
This returns 1.4 (correct) -
select to_number('1.4','9D9');
This returns the aforementioned error
select to_number('1d4','9D9');
Still not quite sure why it's complaining about NUMERIC(1,0)
but at least I know *why* there's an error.
Asked by ConanTheGerbil
(1303 rep)
Jan 1, 2021, 10:07 PM
Last activity: Jan 2, 2021, 06:49 PM
Last activity: Jan 2, 2021, 06:49 PM