Re: Unique primary index? - Mailing list pgsql-sql

From PFC
Subject Re: Unique primary index?
Date
Msg-id op.ss3av5both1vuj@localhost
Whole thread Raw
In response to Unique primary index?  (orange_crush_068@hotmail.com)
Responses Re: Unique primary index?  (Scott Marlowe <smarlowe@g2switchworks.com>)
List pgsql-sql
index is... an index !

UNIQUE is an index which won't allow duplicate values (except for NULLS)

PRIMARY KEY is exactly like UNIQUE NOT NULL, with the bonus that the  
database knows this column is the primary key so you can use stuff like  
NATURAL JOIN without telling which column you want to use.



>
> What are the major differences between Unique, primary index & just
> plain index?
>
> When creating tables I nominate one of these, but not sure what the
> difference is?
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>




pgsql-sql by date:

Previous
From: Bruno Wolff III
Date:
Subject: Re: Unique primary index?
Next
From: PFC
Date:
Subject: Re: ENUM like data type