Re: case insensitive search - Mailing list pgsql-php

From knut.suebert@web.de
Subject Re: case insensitive search
Date
Msg-id 20020315173341.GC6266@web.de
Whole thread Raw
In response to Re: case insensitive search  (Gurudutt <guru@indvalley.com>)
List 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

pgsql-php by date:

Previous
From: timothy_maguire@hartehanks.com
Date:
Subject: Re: case insensitive search
Next
From: Frank Joerdens
Date:
Subject: pg_errormessage within a transaction block (doesn't work as expected)