ERROR: operator does not exist: date <= integer LINE 1: ...RE product.id = price.prod_id and price.effective <= 2012020... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.