Diagnostic Queries
Symptoms
A string given where a double precision (float8) was expected is not a valid floating-point number. PostgreSQL raises SQLSTATE 22P02 (invalid_text_representation).
- Non-numeric text or malformed float in a numeric field.
- Common with empty strings or locale decimal commas.
- The message echoes the offending value.
What the server log shows
ERROR: invalid input syntax for type double precision: "1.0.0"
Why PostgreSQL raises this — what the manual says
Section 8.1.3 Floating-Point Types:
“The data types real and double precision are inexact, variable-precision numeric types.”
The float8 input function parses the text as a floating-point literal (optionally NaN/Infinity). Malformed input cannot be parsed and is rejected with 22P02.
Common causes
- Multiple decimal points or stray characters.
- A locale decimal comma (
1,5) instead of a point. - An empty string passed instead of NULL.
How to fix it
- Normalize numeric text (single decimal point, no separators).
- Convert locale decimals to a point before insert.
- Use NULL for missing values.
Related & next steps
Reference: PostgreSQL 18 Section 8.1 “Numeric Types”.
Thanks — noted. This helps keep the database accurate.