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

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:27:40
Message-ID: 4B66583C.1050708@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tom Lane schrieb:
> Andreas <maps(dot)on(at)gmx(dot)net> writes:
>
>> So I had the missconception that UNIQUE (...) within CREATE TABLE (...)
>> was actually just an shorter way to define a unique index which it is not.
>>
>
> 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? The parser could just
take everything in the ( ) and use it as is.

Somehow there must be a notice in the meta data to mark the difference.
pgAdmin shows a unique as constraint but no index when created within
"create table".
The unique-index only shows up when created seperately.

regards
Andreas

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2010-02-01 04:41:56 Re: Howto have a unique restraint on UPPER (textfield)
Previous Message Dave Clements 2010-02-01 04:25:23 Re: Fwd: Help required on query performance