Re: Unique primary index?

From: PFC <lists(at)boutiquenumerique(dot)com>
To: orange_crush_068(at)hotmail(dot)com, pgsql-sql(at)postgresql(dot)org
Subject: Re: Unique primary index?
Date: 2005-06-28 17:01:07
Message-ID: op.ss3av5both1vuj@localhost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
>

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Scott Marlowe 2005-06-28 17:47:22 Re: Unique primary index?
Previous Message PFC 2005-06-28 16:58:32 Re: ENUM like data type