X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 446B15E46CC for ; Thu, 2 Sep 2004 11:36:53 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 85871-04 for ; Thu, 2 Sep 2004 14:36:51 +0000 (GMT) Received: from matrix.gatewaynet.com (matrix.gatewaynet.com [217.19.69.50]) by svr1.postgresql.org (Postfix) with ESMTP id C10BA5E472F for ; Thu, 2 Sep 2004 11:36:47 -0300 (ADT) Received: from matrix.gatewaynet.com (localhost.localdomain [127.0.0.1]) by matrix.gatewaynet.com (8.12.8/8.12.8) with ESMTP id i82DoHsR005504; Thu, 2 Sep 2004 16:50:17 +0300 Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.12.8/8.12.8/Submit) with ESMTP id i82DoHNq005500; Thu, 2 Sep 2004 16:50:17 +0300 Date: Thu, 2 Sep 2004 16:50:17 +0300 (EEST) From: Achilleus Mantzios To: Nosyman Cc: pgsql-sql@postgresql.org Subject: Re: PRIMARY KEY and INDEX In-Reply-To: <200409021358.i82DwGQ8022806@acten.itcnet.ro> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200409/27 X-Sequence-Number: 18873 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