Search Postgresql Archives

Re: Difference between UNIQUE constraint vs index

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>> I would imagine that other DBMSes also enforce uniqueness by means of
>>> indexes, because it'd be awful darn expensive to enforce the constraint
>>> without one; but I'm only guessing here, not having looked.  Can anyone
>>> point to a real system that enforces unique constraints without an
>>> underlying index?
> 
> In Rdb/VMS (which does not use MVCC), PK (and it's alias UNIQUE)
> constraints are independent of whether you have a unique index on
> the table.

PK is NOT an alias for UNIQUE. Yes it does have the same functional
operation but it is technically incorrect to consider them the same.

> 
> Now, 99.44% of the time you will *not* have a PK constraint, but
> simply a unique index.

Then you have designed your database incorrectly.

Sincerely,

Joshua D. Drake

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly



-- 

      === The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive  PostgreSQL solutions since 1997
             http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux