Re: IS it a good practice to use SERIAL as Primary Key?

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
Cc: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: IS it a good practice to use SERIAL as Primary Key?
Date: 2006-11-27 20:54:58
Message-ID: 1164660898.16182.84.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2006-11-27 at 13:38 -0700, Scott Ribe wrote:
> > primary key (first_name,last_name,address_id)
> >
> > One will enable you to have a distinct Joshua Drake, one in portland
> > oregon and one in portland maine.
>
> What happens when you move? Do we treat you as a different person? Or do we
> pretend that you've always lived in the same place?

You would update the address, the address id wouldn't change. If you
want to keep track of old addresses you would keep an archive table
associated with the user.id.

Sincerely,

Joshua D. Drake

>
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Ribe 2006-11-27 21:00:35 Re: IS it a good practice to use SERIAL as Primary Key?
Previous Message Ron Johnson 2006-11-27 20:52:36 Re: IS it a good practice to use SERIAL as Primary Key?