Re: Case sensitivity - Mailing list pgsql-general

From Richard Huxton
Subject Re: Case sensitivity
Date
Msg-id 42F72C06.8000000@archonet.com
Whole thread Raw
In response to Case sensitivity  ("Frank Millman" <frank@chagford.com>)
Responses Re: Case sensitivity  ("Frank Millman" <frank@chagford.com>)
Re: Case sensitivity  ("Frank Millman" <frank@chagford.com>)
Re: Case sensitivity  ("Frank Millman" <frank@chagford.com>)
List pgsql-general
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

pgsql-general by date:

Previous
From: Lipy Reis
Date:
Subject: remove
Next
From: Mario Soto Cordones - Venezuela
Date:
Subject: Re: postgresql Secure Mode