Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 2ECAD47589C for ; Wed, 10 Jul 2002 17:10:34 -0400 (EDT) Received: by news.hub.org (Postfix, from userid 8) id 8562C381BB9; Wed, 10 Jul 2002 17:10:29 -0400 (EDT) From: linux_211@hotmail.com (igor) X-Newsgroups: comp.databases.postgresql.general, comp.databases.postgresql.questions Subject: Re: Disabling case sensitivity Date: 10 Jul 2002 12:36:20 -0700 Organization: http://groups.google.com/ Lines: 31 Message-ID: References: <20020710133339.GA16235@nic.fr> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: groups-abuse@google.com To: pgsql-general@postgresql.org X-Archive-Number: 200207/640 X-Sequence-Number: 27127 > > 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?