Обсуждение: pattern matching
I am trying to search for text(varchar) using the ILIKE operator, however I always get a parser error. Similarly the ~~* operator does not work. (actually, doesn't exist)
Can anyone tell me whether this feature is implemented yet or not.
If not, is there an easy way to perform case-insensitive 'LIKE' search's?
Alan Nilssonanilsson@apple.com
How hard can it be?
On Tue, 9 Jan 2001, Alan Nilsson wrote:
> I am trying to search for text(varchar) using the ILIKE operator,
> however I always get a parser error. Similarly the ~~* operator does
> not work. (actually, doesn't exist)
The case-insensitive regexp operator is ~*, and it does work in
PostgreSQL. There is no ~~* or ILIKE, but you can do LIKE UPPER('*text*')
to achieve the same thing.
-- Brett
http://www.chapelperilous.net/~bmccoy/
---------------------------------------------------------------------------
According to my best recollection, I don't remember.
-- Vincent "Jimmy Blue Eyes" Alo
"Brett W. McCoy" <bmccoy@chapelperilous.net> writes:
> The case-insensitive regexp operator is ~*, and it does work in
> PostgreSQL. There is no ~~* or ILIKE,
Both are new for 7.1, I believe.
> but you can do LIKE UPPER('*text*')
> to achieve the same thing.
Good workaround for older versions.
Alan appears to have been reading the development docs rather than
the release-version docs ...
regards, tom lane