Re: [GENERAL] How to create case insensitive unique constraint

2005-09-21 Thread Andrus
> You could use upper() similarly - lower() is better for Unicode data, like > mine. John, thank you. Excellent. I have database encoding UNICODE. Why lower() is better than upper()? Andrus. ---(end of broadcast)--- TIP 9: In versions below 8

Re: [GENERAL] How to create case insensitive unique constraint

2005-09-21 Thread John D. Burger
I want to disable dupplicate customer names in a database regardless to case. I tried CREATE TABLE customer ( id SERIAL, name CHARACTER(70)); ALTER TABLE customer ADD constraint customer_name_unique UNIQUE (UPPER(name)); but this is not allowed in Postgres As Csaba suggested, a unique fun

Re: [GENERAL] How to create case insensitive unique constraint

2005-09-21 Thread Csaba Nagy
I guess you can create a unique functional index with upper as the function. Try to look up the docs for CREATE INDEX. HTH, Csaba. On Wed, 2005-09-21 at 18:15, Andrus wrote: > I want to disable dupplicate customer names in a database regardless to > case. > > I tried > > CREATE TABLE customer