Query failed: ERROR: operator does not exist: text = integer LINE 1: ...FROM "public"."news" WHERE to_char("date",'YYYY') = 2010 AND... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.