pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bart Ogryczak <bart@bart.w-wa.pl>
To: pgsql-sql@postgreSQL.org
Subject: Re: [SQL] Searching Text Fields - Case Sensitive?
Date: Fri, 13 Aug 1999 11:07:18 +0200
Message-ID: <37B3E046.278547CA@bart.w-wa.pl> (raw)
References: <003401bee4d3$42774e20$0200a8c0@mike>
	<37B2E714.DB904C2B@bart.w-wa.pl>
	<002801bee560$2e499d30$760e01a3@oucs.ox.ac.uk>

Moray McConnachie wrote:

> > > SELECT * FROM mydb WHERE description LIKE "%foobar%";
> > > it seems to be case sensitive.  Is there a way to do it so it is NOT
> > > case-sensitive?
> > SELECT * FROM mydb WHERE lower(description) LIKE "%foobar%";
> 
> Brings up an interesting question. Which is faster, to use the lower/upper
> functions as above 
[...]
> or to use the pattern matching case-insensitive operator?
	LIKE seems to be much simpler then the regex pattern matching,
so IMHO, the lower/upper & LIKE combination may be faster for short
fields,
but probably might be slower on very long text fields (when it has to
convert
whole thing to lower/upper case, before doing LIKE). 
	Anyway, the differences are probably almost none either way.

bart
-- 
bart@bart.w-wa.pl || http://www.bart.w-wa.pl



view thread (5+ messages)  latest in thread

Message-ID: <37B3E046.278547CA@bart.w-wa.pl>
Permalink:  ../37B3E046.278547CA@bart.w-wa.pl/
Also on:    postgresql.org/message-id/37B3E046.278547CA@bart.w-wa.pl

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: bart@bart.w-wa.pl
  Subject: Re: [SQL] Searching Text Fields - Case Sensitive?
  In-Reply-To: <37B3E046.278547CA@bart.w-wa.pl>
  References: <003401bee4d3$42774e20$0200a8c0@mike> <37B2E714.DB904C2B@bart.w-wa.pl> <002801bee560$2e499d30$760e01a3@oucs.ox.ac.uk> <37B3E046.278547CA@bart.w-wa.pl>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox