Case in-sensitive

Started by Carmen Waiover 23 years ago4 messagesgeneral
Jump to latest
#1Carmen Wai
wai_carmen@hotmail.com

Hello:

Can I config the Postgresql so that it can match case in-sensitive pattern
automatically? i.e. I don't need to explicit convert the pattern to lower
case like this: .....WHERE lower(textfield) LIKE lower(pattern)

Thanks a lot!

Carmen

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

#2Andrew Sullivan
andrew@libertyrms.info
In reply to: Carmen Wai (#1)
Re: Case in-sensitive

On Tue, Jul 23, 2002 at 02:35:40PM +0000, Carmen Wai wrote:

Hello:

Can I config the Postgresql so that it can match case in-sensitive pattern
automatically? i.e. I don't need to explicit convert the pattern to lower
case like this: .....WHERE lower(textfield) LIKE lower(pattern)

No. But you can use ILIKE, which is a case-insensitive LIKE.

A

-- 
----
Andrew Sullivan                               87 Mowat Avenue 
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M6K 3E3
                                         +1 416 646 3304 x110
#3Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Carmen Wai (#1)
Re: [SQL] Case in-sensitive

Can I config the Postgresql so that it can match case
in-sensitive pattern
automatically? i.e. I don't need to explicit convert the pattern to lower
case like this: .....WHERE lower(textfield) LIKE lower(pattern)

All you need to do is this:

......WHERE textfield ILIKE pattern

Chris

#4Josh Berkus
josh@agliodbs.com
In reply to: Christopher Kings-Lynne (#3)
Re: [SQL] Case in-sensitive

Chris,

Can I config the Postgresql so that it can match case
in-sensitive pattern
automatically? i.e. I don't need to explicit convert the pattern to lower
case like this: .....WHERE lower(textfield) LIKE lower(pattern)

All you need to do is this:

......WHERE textfield ILIKE pattern

Though, keep in mind, lower(textfield) can be indexed, but ILIKE textfield
cannot.

--
-Josh Berkus
Aglio Database Solutions
San Francisco