On Mon, Nov 12, 2007 at 02:19:21PM +0100, Patric Bechtel wrote:
> Just guess: We have bigint id's through the system, so I want to give
> the users the convenience of typing only the last 4-5 digits (which most
> of the time is enough). So the query we issue really is
> ... like "%$userinput"
> Makes sense, or?
where id % 1000 = $userinput; (for 4-digit-long-userinput)
will do the same, and at the very least will not bail out on 8.3
on the other hand. while i know and understand why there can't be "="
operator for text and int, i think that "like" could be readded as it is
really clear about how it works.
depesz
--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA. here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)