Re: uppercase = lowercase

From: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
To: jose antonio leo <jaleo8(at)storelandia(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: uppercase = lowercase
Date: 2003-02-14 10:20:01
Message-ID: 1045218001.10914.122.camel@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-advocacy

On Fri, 2003-02-14 at 08:51, jose antonio leo wrote:

> How can I make selects not sensitive uppercase and lowercase characters?
> This is possible modifying something of psql configuration?

I take it you mean that

SELECT x FROM t WHERE x = 'abc';

should also return rows where x = 'ABC' and x = 'Abc' and so on.

The answer is to make your condition say what it means:

SELECT x FROM t WHERE lower(x) = 'abc'.

If you do this a lot, you may well want to create an index on lower(x).

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight, UK http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"God be merciful unto us, and bless us; and cause his
face to shine upon us." Psalms 67:1

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message P G 2003-02-14 12:33:07 What is the default timeout setting for connections to the db?
Previous Message jose antonio leo 2003-02-14 08:51:28 uppercase = lowercase

Browse pgsql-advocacy by date

  From Date Subject
Next Message Richard Huxton 2003-02-14 11:21:23 Default Configuration/Tuning - Summary
Previous Message jose antonio leo 2003-02-14 08:51:28 uppercase = lowercase