Re: Case Insensitive comparison - Mailing list pgsql-sql

From Roberto Mello
Subject Re: Case Insensitive comparison
Date
Msg-id 20030925053008.GC4203@cc.usu.edu
Whole thread Raw
In response to Case Insensitive comparison  ("George A.J" <jinujosein@yahoo.com>)
Responses Re: Case Insensitive comparison  (Bruno Wolff III <bruno@wolff.to>)
Re: Case Insensitive comparison  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql
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
caseinsensitive in postgresql without using an upper() or lower() function in both sides (=). Is there any option to
setin 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!


pgsql-sql by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: Case Insensitive comparison
Next
From: Tom Lane
Date:
Subject: Re: Case Insensitive comparison