pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Elphick <olly@lfix.co.uk>
To: Kenneth Gonsalves <lawgon@thenilgiris.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: surrogate key or not?
Date: Sun, 08 Aug 2004 02:06:36 +0100
Message-ID: <1091927196.13140.174.camel@linda> (raw)
In-Reply-To: <0408070930300J.01190@thenilgiris.com>
References: <1090325769.3241.27.camel@dicaprio.akademie1.de>
	<41026D55.3040002@zara.6.isreserved.com>
	<200408061542.04336.josh@agliodbs.com>
	<0408070930300J.01190@thenilgiris.com>

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 men succeed in their ways, when they
      carry out their wicked schemes." 
                            Psalms 37:7 




view thread (44+ messages)  latest in thread

Message-ID: <1091927196.13140.174.camel@linda>
Permalink:  ../1091927196.13140.174.camel@linda/
Also on:    postgresql.org/message-id/1091927196.13140.174.camel@linda

 · 

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: olly@lfix.co.uk, lawgon@thenilgiris.com
  Subject: Re: surrogate key or not?
  In-Reply-To: <1091927196.13140.174.camel@linda>

* 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