Re: case insensitive search

From: knut(dot)suebert(at)web(dot)de
To: PGSQL <pgsql-php(at)postgresql(dot)org>
Subject: Re: case insensitive search
Date: 2002-03-15 17:33:41
Message-ID: 20020315173341.GC6266@web.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-php

Gurudutt schrieb:
> Hello arun,
>
> ak> how to do a case insensitive search on postgresql database. i will
> ak> enter a keyword in text field and it has to search for that keyword in
> ak> keywords field of table and should be case insensitive.
>
> why don't you use "ilike" to search for the pattern in the database.

or POSIX:

4.6.2. POSIX Regular Expressions

Table 4-10. Regular Expression Match Operators

Operator Description Example
~ regex, case sensitive 'thomas' ~ '.*thomas.*'
~* regex, case insensitive 'thomas' ~* '.*Thomas.*'
!~ not regex, case sensitive 'thomas' !~ '.*Thomas.*'
!~* not regex, case insensitive 'thomas' !~* '.*vadim.*'

G,
K

In response to

Browse pgsql-php by date

  From Date Subject
Next Message Jon Hassen 2002-03-15 17:36:41 Re: case insensitive search
Previous Message Marcelo Pereira 2002-03-15 16:16:54 Re: Graphics