Re: "select ... where field like lower('%text%')" fails - Mailing list pgsql-bugs

From Thomas Lockhart
Subject Re: "select ... where field like lower('%text%')" fails
Date
Msg-id 3AA5007F.42835AED@alumni.caltech.edu
Whole thread Raw
In response to "select ... where field like lower('%text%')" fails  (pgsql-bugs@postgresql.org)
List pgsql-bugs
There is no bug. You want case-insensitive pattern matching, which is
not what your call to "tolower()" accomplishes.

The query

  SELECT company from user_tbl where company like lower('%SEaN%');

will find all strings which contain "sean" (note case!). It will not
match strings containing "Sean". Look in the PostgreSQL docs for hints
on how to do case-insensitive searches.

                      - Thomas

pgsql-bugs by date:

Previous
From: lonnie
Date:
Subject: interface differences in the 7.0.3 version
Next
From: Ivan Baldo
Date:
Subject: 7.0.3 - Backend crash on simple SELECT query