Re: Disabling case sensitivity

From: linux_211(at)hotmail(dot)com (igor)
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Disabling case sensitivity
Date: 2002-07-10 19:36:20
Message-ID: ff6ce15e.0207101136.546ae812@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-general

> > 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?

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Nathan Hill 2002-07-10 19:45:04 XML to Postgre conversion
Previous Message Gaetano Mendola 2002-07-10 16:18:32 View chached inside function

Browse pgsql-general by date

  From Date Subject
Next Message Michael Adler 2002-07-10 19:38:49 hash(text) function inside db?
Previous Message Marc G. Fournier 2002-07-10 18:42:33 Re: I am being interviewed by OReilly