pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: isaac flemmin <isaac@knox.net>
To: 'Stephan Szabo' <sszabo@megazone23.bigpanda.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Case insensitive select
Date: Wed, 12 Jun 2002 21:35:15 -0700
Message-ID: <web-1525843@davinci.ethosmedia.com> (raw)
In-Reply-To: <000001c2127e$df411980$ad463e04@ixic>

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



view thread (6+ messages)

Message-ID: <web-1525843@davinci.ethosmedia.com>
Permalink:  ../web-1525843@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-1525843@davinci.ethosmedia.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, isaac@knox.net, sszabo@megazone23.bigpanda.com
  Subject: Re: Case insensitive select
  In-Reply-To: <web-1525843@davinci.ethosmedia.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox