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 BE19CD1B174 for ; Fri, 23 Jul 2004 07:35:55 -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 53721-08 for ; Fri, 23 Jul 2004 10:35:45 +0000 (GMT) Received: from sharp.noc24x7.com (unknown [69.56.128.138]) by svr1.postgresql.org (Postfix) with ESMTP id 81FEED1B16A for ; Fri, 23 Jul 2004 07:35:36 -0300 (ADT) Received: from [61.1.218.186] (helo=thenilgiris.com) by sharp.noc24x7.com with asmtp (Exim 4.34) id 1BnxOv-0007Fx-Eq; Fri, 23 Jul 2004 16:05:46 +0530 Received: from localhost (localhost [[UNIX: localhost]]) by thenilgiris.com (8.11.2/8.11.2) id i6N90Bl26035; Fri, 23 Jul 2004 14:30:11 +0530 Content-Type: text/plain; charset="iso-8859-1" From: Kenneth Gonsalves To: Michael Glaesemann Subject: Re: surrogate key or not? Date: Fri, 23 Jul 2004 14:30:10 +0530 X-Mailer: KMail [version 1.2] Cc: Karsten Hilbert , pgsql-sql@postgresql.org References: <1090325769.3241.27.camel@dicaprio.akademie1.de> <0407231327461F.01150@thenilgiris.com> In-Reply-To: MIME-Version: 1.0 Message-Id: <0407231430101G.01150@thenilgiris.com> Content-Transfer-Encoding: 8bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - sharp.noc24x7.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - thenilgiris.com X-Source: X-Source-Args: X-Source-Dir: 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: 200407/196 X-Sequence-Number: 18448 On Friday 23 July 2004 03:29 pm, Michael Glaesemann wrote: > > You appear to be misunderstanding the purpose of a primary key. A > primary key is used to ensure there is a way to identify each row > uniquely. It is quite independent of which columns you may or may not > want to search on. If name is not going to be necessarily unique in the > table, it isn't a primary key. ive not misunderstood anything. this is one of the tables in question: address_type id serial PRIMARY KEY name text UNIQUE NOT NULL i think it is self explanatory -- regards kg http://www.onlineindianhotels.net - hotel bookings reservations in over 4600 hotels in India http://www.ootygolfclub.org