Re: primary key on lower(varchar) - Mailing list pgsql-novice

From Tom Lane
Subject Re: primary key on lower(varchar)
Date
Msg-id 25937.1136608548@sss.pgh.pa.us
Whole thread Raw
In response to primary key on lower(varchar)  (<me@alternize.com>)
List pgsql-novice
<me@alternize.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

pgsql-novice by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: SQL Question
Next
From:
Date:
Subject: Re: primary key on lower(varchar)