The operator does not exist

When I try to create an object in a Spring -roo PostGres project, I get the following error:

ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: operator does not exist: integer ~~ unknown
Hint: No operator matches the given name and argument type(s). You might need to add explicit type casts.
Position: 433

What could be the solution?

+3
source share
1 answer

An unknown type usually occurs when you have a string literal, and Postgres ends up trying to decide if it is a varchar, text, literal array, etc.

Change the line if necessary, for example:

'2'::int

Or do not quote it first, if applicable.

+7
source

All Articles