Re: Howto have a unique restraint on UPPER (textfield)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas <maps(dot)on(at)gmx(dot)net>
Cc: Joshua Tolley <eggyknap(at)gmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Howto have a unique restraint on UPPER (textfield)
Date: 2010-02-01 04:41:56
Message-ID: 29274.1264999316@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Andreas <maps(dot)on(at)gmx(dot)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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Marlowe 2010-02-01 05:16:15 Re: Fwd: Help required on query performance
Previous Message Andreas 2010-02-01 04:27:40 Re: Howto have a unique restraint on UPPER (textfield)