Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Operator does not exist

When trying to create an entity 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 ?

like image 995
gpasse Avatar asked Feb 23 '26 08:02

gpasse


1 Answers

Type unknown usually occurs when you've a string literal and Postgres ends up trying to decide if it's a varchar, text, literal array, etc.

Cast your string as needed, e.g.:

'2'::int

Or don't quote it in the first place, if applicable.

like image 94
Denis de Bernardy Avatar answered Feb 25 '26 04:02

Denis de Bernardy