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: John McCawley <nospam(at)hardgeus(dot)com>, pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: IS it a good practice to use SERIAL as Primary Key?
Date: 2006-11-28 00:53:46
Message-ID: 1164675226.6398.41.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2006-11-27 at 17:22 -0700, Scott Ribe wrote:
> >> I promise I'm not trying to be a pain in the butt ;) Do you then use
> >> your serial id as your foreign key in other tables, or the
> >> firstname/lastname primary key?
> >
> > Now that is a good question. I would use the id, but that is not
> > technically proper :).
>
> But firstname/lastname is *NOT* a primary key. Merely calling it one in the
> db schema does not make it so.

It certainly could be a primary key it depends on the data requirements.

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

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2006-11-28 00:55:48 Re: IS it a good practice to use SERIAL as Primary Key?
Previous Message Joshua D. Drake 2006-11-28 00:52:40 Re: IS it a good practice to use SERIAL as Primary Key?