Postgres: ERROR: operator does not exist: character varying = bigint

Your order_number is a varchar, you can't compare that to a number (123 is a number in SQL, '123' is a string constant)

You need to use string literals:

order_number in ('1512011196169','1512011760019','1512011898493','1512011972111')

More details in the manual:
http://www.postgresql.org/docs/current/static/sql-syntax-lexical.html#SQL-SYNTAX-CONSTANTS


If you can't change the type of numbers within in, you could use cast:

select * from numbers_as_string
where cast(my_numbers_as_string as int) in (1,2,3)

Tags:

Postgresql