Re: surrogate key or not? - Mailing list pgsql-sql

From Oliver Elphick
Subject Re: surrogate key or not?
Date
Msg-id 1091927196.13140.174.camel@linda
Whole thread Raw
In response to Re: surrogate key or not?  (Kenneth Gonsalves <lawgon@thenilgiris.com>)
Responses Re: surrogate key or not?
List pgsql-sql
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.

-- 
Oliver Elphick                                          olly@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA  92C8 39E7 280E 3631 3F0E  1EC0 5664 7A2F A543 10EA
========================================   "Be still before the LORD and wait patiently for him;     do not fret when
mensucceed in their ways, when they     carry out their wicked schemes."                            Psalms 37:7 
 



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: reply to setting
Next
From: Kenneth Gonsalves
Date:
Subject: Re: surrogate key or not?