From: Richard Huxton <dev@archonet.com>
To: Frank Millman <frank@chagford.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Case sensitivity
Date: Mon, 08 Aug 2005 10:55:18 +0100
Message-ID: <42F72C06.8000000@archonet.com> (raw)
In-Reply-To: <VPOP32.1.0e.20050806113716.078.2.1.a40c1f81@chagford.com>
References: <VPOP32.1.0e.20050806113716.078.2.1.a40c1f81@chagford.com>
Frank Millman wrote:
> Hi all
>
> Is there an LC_COLLATE setting, or any other method, which allows all data
> in a database to be treated in a case-insensitive manner?
>
> I have two scenarios in mind. There are workarounds for both of them, but it
> would be nice if they were not necessary.
>
> 1. In a UNIQUE column, I would like a value of 'a' to be rejected if there
> is already a value of 'A'. Workaround - create a unique index on
> LOWER(col_name).
>
> 2. I would like WHERE col_name = 'x' and WHERE col_name LIKE 'x%' to find
> 'X' and 'X1'. Workaround - WHERE LOWER(col_name) = 'x' and WHERE col_name
> ILIKE 'x%'.
You could define your own type if you want to go to that level of
effort. Or, you could just decide only to allow upper-case values (or
lower-case).
--
Richard Huxton
Archonet Ltd
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-general@postgresql.org
Cc: dev@archonet.com, frank@chagford.com
Subject: Re: Case sensitivity
In-Reply-To: <42F72C06.8000000@archonet.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