Re: PRIMARY KEY and INDEX

From: Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
To: Nosyman <nosyman(at)easymail(dot)ro>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: PRIMARY KEY and INDEX
Date: 2004-09-02 13:50:17
Message-ID: Pine.LNX.4.44.0409021649070.5211-100000@matrix.gatewaynet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)postgresql(dot)org)
>

--
-Achilleus

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruno Wolff III 2004-09-02 13:51:08 Re: copy old column's values to new column
Previous Message ogjunk-pgjedan 2004-09-02 13:16:47 copy old column's values to new column