Re: Case insensitive select - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Case insensitive select
Date
Msg-id web-1525843@davinci.ethosmedia.com
Whole thread Raw
In response to Re: Case insensitive select  ("isaac flemmin" <isaac@knox.net>)
List pgsql-sql
Isaac,

> Yes that worked. Thanks! I will have to look more at the lower
> function
> now so I know why that worked!

It has nothing to do with the LOWER function, which is straigthforward.

You made the beginner's mistake of defining your column as CHAR and not
VARCHAR.  As a result, what is actually being stored in your database
is not:
"Value"
"Value1"
but:
"Value     "
"Value1   "

This is what is causing your search problems.  Dump the table, and
re-build it with the correct data types (VARCHAR!).   I would also
strongly reccomend that you pick up a beginner's book on SQL database
building.  See:
http://techdocs.postgresql.org/techdocs/bookreviews.php

Also, unlike most other RDBMS, CHAR is *not* more efficient than
VARCHAR in Postgres.

-Josh Berkus


pgsql-sql by date:

Previous
From: "isaac flemmin"
Date:
Subject: Re: Case insensitive select
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: How to remove contraint