Introducing our new eBook: "Best Practices for Optimizing Postgres Query Performance"Download Now

U111: Invalid input syntax

Category: Application / User Errors
SQLSTATE: 22P02 (Class 22 — Data Exception: invalid_text_representation)
Urgency: low

Example Postgres Log Output:

ERROR: invalid input syntax for integer: "" at character 40"
STATEMENT: SELECT * FROM table WHERE int_column = ''

ERROR: invalid input syntax for type boolean: "foo"
STATEMENT: SELECT bool 'foo' AS error;

ERROR:  invalid input syntax for type real: "aaa"
CONTEXT:  COPY agg_bad, line 3, column b: "aaa"

Explanation:

You will see this log event when a column in a query gets a value passed that is not compatible with the underlying input type's syntax requirements.

For example, you will get this error if you / your application passes an alphabetic string to a query field of integer type.

Recommended Action:

Review application code for user input formatting and sanitization logic, if this occurred on a production system.

Learn More:

No additional resources available.


Couldn't find what you were looking for or want to talk about something specific?
Start a conversation with us →