I have an indexed column called home_phone, which is of type bigint.
How can I search this column efficiently, using LIKE queries? For
example:
test=> SELECT id FROM user WHERE home_phone LIKE '407%'::bigint;
ERROR: Bad int8 external representation "407%"
Obviously, that's not correct, but I'm confused as to how the % and ?
characters can be used along with type-casting. Or can they?