Re: PRIMARY KEY and INDEX - Mailing list pgsql-sql

From Achilleus Mantzios
Subject Re: PRIMARY KEY and INDEX
Date
Msg-id Pine.LNX.4.44.0409021649070.5211-100000@matrix.gatewaynet.com
Whole thread Raw
In response to PRIMARY KEY and INDEX  ("Nosyman" <nosyman@easymail.ro>)
List pgsql-sql
O kyrios Nosyman egrapse stis Sep 2, 2004 :

> It is necessary to define an index for a primary key column?
> 
> Let's have an example
> CREATE TABLE users(
> id_user INTEGER PRIMARY KEY,
> user_name VARCHAR(25)
> );
> 
> Does PgSQL automatically create an index for id_user (primary key) or it
> must be created by hand?

Yes a unique index is created automatically so as to enforce the 
PK constraint.

> 
> Thanks
> 
> 
> _________________________________________________________________
> Message
> sent using ITCNet free webmailer (http://www.easymail.ro)
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
> 

-- 
-Achilleus



pgsql-sql by date:

Previous
From: "Nosyman"
Date:
Subject: PRIMARY KEY and INDEX
Next
From: Devrim GUNDUZ
Date:
Subject: Re: PRIMARY KEY and INDEX