Tag Archives: postgres Errror

How to Solve postgres Errror: ERROR #42883 operator does not exist: smallint ~~ unknown

Problem background

What is written in the code is general. After an error is reported, it is found that the value in like is actually an integer, but the code is spliced with strings. Therefore, in fact, when postgre queries, SQL is executed with integer columns and string parameters, and this error is reported.

Namely column LIKE ‘%0%’

The same is true for SQL queries:

Solution:

Strings can be queried vaguely, but when querying, if the column is an integer, just use the equal sign directly. Judge in the code. If the column is an integer, splice it=  Don’t use like