pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleus Mantzios <achill@matrix.gatewaynet.com>
To: Nosyman <nosyman@easymail.ro>
Cc: pgsql-sql@postgresql.org
Subject: Re: PRIMARY KEY and INDEX
Date: Thu, 2 Sep 2004 16:50:17 +0300 (EEST)
Message-ID: <Pine.LNX.4.44.0409021649070.5211-100000@matrix.gatewaynet.com> (raw)
In-Reply-To: <200409021358.i82DwGQ8022806@acten.itcnet.ro>

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




view thread (3+ messages)  latest in thread

Message-ID: <Pine.LNX.4.44.0409021649070.5211-100000@matrix.gatewaynet.com>
Permalink:  ../Pine.LNX.4.44.0409021649070.5211-100000@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/Pine.LNX.4.44.0409021649070.5211-100000@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: achill@matrix.gatewaynet.com, nosyman@easymail.ro
  Subject: Re: PRIMARY KEY and INDEX
  In-Reply-To: <Pine.LNX.4.44.0409021649070.5211-100000@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox