pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kenneth Gonsalves <lawgon@thenilgiris.com>
To: Oliver Elphick <olly@lfix.co.uk>
Cc: pgsql-sql@postgresql.org
Subject: Re: surrogate key or not?
Date: Sun, 8 Aug 2004 05:59:37 +0530
Message-ID: <0408080559370M.01190@thenilgiris.com> (raw)
In-Reply-To: <1091927196.13140.174.camel@linda>
References: <1090325769.3241.27.camel@dicaprio.akademie1.de>
	<0408070930300J.01190@thenilgiris.com>
	<1091927196.13140.174.camel@linda>

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



view thread (44+ messages)  latest in thread

Message-ID: <0408080559370M.01190@thenilgiris.com>
Permalink:  ../0408080559370M.01190@thenilgiris.com/
Also on:    postgresql.org/message-id/0408080559370M.01190@thenilgiris.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: lawgon@thenilgiris.com, olly@lfix.co.uk
  Subject: Re: surrogate key or not?
  In-Reply-To: <0408080559370M.01190@thenilgiris.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