X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 532F7D1B50E for ; Thu, 25 Sep 2003 05:30:57 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 64688-02 for ; Thu, 25 Sep 2003 02:30:27 -0300 (ADT) Received: from brasileiro.net (slxwy.dorms.usu.edu [129.123.227.103]) by svr1.postgresql.org (Postfix) with ESMTP id 838F9D1B52A for ; Thu, 25 Sep 2003 02:30:09 -0300 (ADT) Received: from roberto by brasileiro.net with local (Exim 3.36 #1 (Debian)) id 1A2Ohd-0001TG-00; Wed, 24 Sep 2003 23:30:09 -0600 Date: Wed, 24 Sep 2003 23:30:08 -0600 From: Roberto Mello To: "George A.J" Cc: pgsql-sql@postgresql.org Subject: Re: Case Insensitive comparison Message-ID: <20030925053008.GC4203@cc.usu.edu> References: <20030925033550.35699.qmail@web14915.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <20030925033550.35699.qmail@web14915.mail.yahoo.com> X-message-flag: Please consider using an e-mail program other than Outlook. It's insecure. User-Agent: Mutt/1.5.4i X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/295 X-Sequence-Number: 15273 On Wed, Sep 24, 2003 at 08:35:50PM -0700, George A.J wrote: > hai > > i am using postgresql 7.3.x. I am converting a database in MS SQL server to PostgreSQL. > > The main problems i am facing is that in sql server the text comparisons are case insensitive. how can i compare text case insensitive in postgresql without using an upper() or lower() function in both sides (=). Is there any option to set in postgresql? > Is there any problem in overriding the = operator that compare text. ie droping the current operator = and creating a new = operator(text,text). Does the existing = operator is using internally by postgres for some porpose. please help Souinds like MS-SQL has broken behavior. Use ILIKE, but I can't remember if you lose indice seaches with that. Overriding the operator should be ok, but again I don't know what the impact on index usage would be. > Another problem is in creating function... > How can i create a function that accept and return any type. the type "any" is not allowing as parameter or return type. Is it possible? i want to create a function similar to NULLIF(). Use the standard coalesce(). -Roberto -- +----| Roberto Mello - http://www.brasileiro.net/ |------+ + Computer Science Graduate Student, Utah State University + + USU Free Software & GNU/Linux Club - http://fslc.usu.edu/ + MONEY TALKS ... but all mine ever says is GOODBYE!