I create a table like this
CREATE TABLE foo (
id serial CONSTRAINT id_pk PRIMARY KEY,
bar varchar(256),
test decimal(5,5)
);
I then want to populate the test column
INSERT INTO foo (test) VALUES (12345.12345)
This gives me
Numeric field overflow Detail: A field with precision 5, scale 5must round to an absolute value less than 1.
I do not understand this. I though if I set a column to decimal(5,5), I must have five digits to the left of the comma and five digits to the right of the comma. I have that with the number 12345.12345.
Why does it give me this error?