Re: Howto have a unique restraint on UPPER (textfield) - Mailing list pgsql-sql

From Tom Lane
Subject Re: Howto have a unique restraint on UPPER (textfield)
Date
Msg-id 29274.1264999316@sss.pgh.pa.us
Whole thread Raw
In response to Re: Howto have a unique restraint on UPPER (textfield)  (Andreas <maps.on@gmx.net>)
List pgsql-sql
Andreas <maps.on@gmx.net> writes:
> Tom Lane schrieb:
>> Well, it is that --- it just doesn't provide access to all the features
>> that CREATE INDEX does.
>> 
> So as it is a shortcut for "create index" then why would the function 
> call of upper not be accepted when the sql parser maps the 
> uniqe-constraint into the "create index" command?

Because the UNIQUE constraint syntax is defined by the SQL standard,
and among other things the standard requires all UNIQUE constraints
to be represented in the information_schema.  But the information_schema
views don't have the flexibility to represent anything but simple column
values in a unique constraint.  So we just expose that in CREATE INDEX,
which is outside the standard anyway.
        regards, tom lane


pgsql-sql by date:

Previous
From: Andreas
Date:
Subject: Re: Howto have a unique restraint on UPPER (textfield)
Next
From: Scott Marlowe
Date:
Subject: Re: Fwd: Help required on query performance