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 120165E3E30 for ; Sat, 7 Aug 2004 23:22:50 -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 03008-02 for ; Sun, 8 Aug 2004 02:22:46 +0000 (GMT) Received: from sharp.noc24x7.com (unknown [69.56.128.138]) by svr1.postgresql.org (Postfix) with ESMTP id A85705E46C0 for ; Sat, 7 Aug 2004 23:22:42 -0300 (ADT) Received: from [61.1.218.253] (helo=thenilgiris.com) by sharp.noc24x7.com with asmtp (Exim 4.34) id 1BtdKh-0002H6-8x; Sun, 08 Aug 2004 07:52:48 +0530 Received: from localhost (localhost [[UNIX: localhost]]) by thenilgiris.com (8.11.2/8.11.2) id i780Tcs25183; Sun, 8 Aug 2004 05:59:38 +0530 Content-Type: text/plain; charset="iso-8859-1" From: Kenneth Gonsalves To: Oliver Elphick Subject: Re: surrogate key or not? Date: Sun, 8 Aug 2004 05:59:37 +0530 X-Mailer: KMail [version 1.2] Cc: pgsql-sql@postgresql.org References: <1090325769.3241.27.camel@dicaprio.akademie1.de> <0408070930300J.01190@thenilgiris.com> <1091927196.13140.174.camel@linda> In-Reply-To: <1091927196.13140.174.camel@linda> MIME-Version: 1.0 Message-Id: <0408080559370M.01190@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: 200408/50 X-Sequence-Number: 18547 On Sunday 08 August 2004 06:36 am, Oliver Elphick wrote: > On Sat, 2004-08-07 at 05:00, Kenneth Gonsalves wrote: > > why shouldnt the primary key change? the only key that should never > > change is a key that is used as a foreign key in another table. In a > > table like this: > > > > id serial unique > > name varchar primary key > > > > name may change - id will never change. id is used as the foreign key > > It can change if you use ON UPDATE CASCADE in the foreign key > definitions. but why would anyone want to change the value of an autogenerated serial row? -- regards kg http://www.onlineindianhotels.net - fastest hotel search website in the world http://www.ootygolfclub.org