pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: ktt <kestutis98@yahoo.com>
To: pgsql-general@postgresql.org
Subject: Re: Disabling case sensitivity
Date: Thu, 11 Jul 2002 05:57:31 -0700 (PDT)
Message-ID: <20020711125731.91850.qmail@web13908.mail.yahoo.com> (raw)
In-Reply-To: <ff6ce15e.0207101136.546ae812@posting.google.com>


That's a problem, because I building
a UNICODE text database and planning case insensitive
search.
Shoul all case insensitive search be 
delivered to PHP or other scripting language?

ktt

--- igor <linux_211@hotmail.com> wrote:
> > > Can't you use something like 
> > > 
> > > SELECT from table where
> tolower(username)='good';
> > 
> > If you want sometimes case-sensitive comparison
> and sometimes not, it
> > is a good solution (the PostgreSQL extension ILIKE
> is another). But if
> > you want to "disable case-sensitivity", you risk
> that some
> > applications forget the call to tolower().
> Therefore, I prefer to
> > create a trigger which will force the field to
> lowercase before
> > INSERTing it. (The problem of my solution is that
> it is no longer
> > case-preserving.)
> > 
> > CREATE FUNCTION force_lower_case() RETURNS OPAQUE
> >    AS 'BEGIN
> >           NEW.name = lower(NEW.name);
> >           RETURN NEW;
> >        END;'
> >      LANGUAGE PLPGSQL;
> > 
> > -- Domain names are only in US-ASCII (so no locale
> problems) and are
> > -- case-insensitive. If you want to record the
> original case, add a
> > -- new field.
> > CREATE TRIGGER force_lower_case 
> >    BEFORE INSERT ON Domains
> >    FOR EACH ROW
> >    EXECUTE PROCEDURE force_lower_case();
> > 
> This is not gonna to work for me. I can't to use
> ILIKE or something
> like that because the program is already written
> ,and I can't change
> the code. There must to be some way how to
> completely disable all
> case-sensitivity from the server without change the
> code, no?
> 
> ---------------------------(end of
> broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org


__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com



view thread (14+ messages)  latest in thread

Message-ID: <20020711125731.91850.qmail@web13908.mail.yahoo.com>
Permalink:  ../20020711125731.91850.qmail@web13908.mail.yahoo.com/
Also on:    postgresql.org/message-id/20020711125731.91850.qmail@web13908.mail.yahoo.com

 · 

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-admin@postgresql.org
  Cc: kestutis98@yahoo.com, pgsql-general@postgresql.org
  Subject: Re: Disabling case sensitivity
  In-Reply-To: <20020711125731.91850.qmail@web13908.mail.yahoo.com>
  References: <ff6ce15e.0207101136.546ae812@posting.google.com> <20020711125731.91850.qmail@web13908.mail.yahoo.com>

* 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