Re: primary key on lower(varchar)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: me(at)alternize(dot)com
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: primary key on lower(varchar)
Date: 2006-01-07 04:35:48
Message-ID: 25937.1136608548@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

<me(at)alternize(dot)com> writes:
> why can't i define a primary key on a varchar field as being
> lower(field)?

Primary keys are only on simple field values; that's what the SQL
standard requires, and that's what we do.

I don't really see the use-case for what you want anyway. Why don't
you just require the field to be all lower case, eg with a CHECK
constraint?

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message me 2006-01-07 05:29:21 Re: primary key on lower(varchar)
Previous Message Michael Fuhr 2006-01-07 02:26:51 Re: SQL Question