type-casting and LIKE queries - Mailing list pgsql-general

From valerian
Subject type-casting and LIKE queries
Date
Msg-id 20030314062602.GA32380@hotpop.com
Whole thread Raw
Responses Re: type-casting and LIKE queries  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Re: type-casting and LIKE queries  (James Gregory <james@anchor.net.au>)
List pgsql-general
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?



pgsql-general by date:

Previous
From: "shreedhar"
Date:
Subject: Is there any tool to set up database automatically
Next
From: John Smith
Date:
Subject: Re: data mining and warehousing