| From: | Oliver Elphick <olly(at)lfix(dot)co(dot)uk> |
|---|---|
| To: | Kenneth Gonsalves <lawgon(at)thenilgiris(dot)com> |
| Cc: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: surrogate key or not? |
| Date: | 2004-08-08 01:06:36 |
| Message-ID: | 1091927196.13140.174.camel@linda |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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(at)lfix(dot)co(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Rod Taylor | 2004-08-08 19:27:15 | Re: Make a column case insensitive |
| Previous Message | Kenneth Gonsalves | 2004-08-08 00:29:37 | Re: surrogate key or not? |