Re: Primary Key

From: "Henshall, Stuart - WCP" <SHenshall(at)westcountrypublications(dot)co(dot)uk>
To: "'denis(at)coralindia(dot)com'" <denis(at)coralindia(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Primary Key
Date: 2002-04-18 08:55:34
Message-ID: E2870D8CE1CCD311BAF50008C71EDE8E01F7484C@MAIL_EXCHANGE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

You need to create a unique index on the function lower (or upper) for your
field. eg:
CREATE UNIQUE INDEX example_index ON table_name (lower(text_column_name));
Hope this helps,
- Stuart

> -----Original Message-----
> From: denis(at)coralindia(dot)com [mailto:denis(at)coralindia(dot)com]
> Sent: 18 April 2002 06:32
> To: pgsql-novice(at)postgresql(dot)org
> Subject: [NOVICE] Primary Key
>
>
> Hi all,
>
> In my table, a TEXT column is a unique column, by default it
> allows "denis"
> and "DENIS" to be entered in same column.
>
> I want the database to ignore CASE for considering uniqueness
> of the data.
>
> for e.g. once "Denis" is entered, it should not allow to
> enter "denis",
> "Denis", "DENIS" , "DeNiS" ...
>
> Thanks
>
> Denis
>
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to
> majordomo(at)postgresql(dot)org)
>

Browse pgsql-novice by date

  From Date Subject
Next Message Tony Griffiths(RA) 2002-04-18 09:26:02 calling functions from embedded sql
Previous Message devi 2002-04-18 06:54:54 How to check success/failure of dml statements