Re: Primary Key

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Primary Key
Date: 2007-11-16 19:01:15
Message-ID: 20071116110115.040ec1f9@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Fri, 16 Nov 2007 18:54:22 +0000
Sam Mason <sam(at)samason(dot)me(dot)uk> wrote:

> On Fri, Nov 16, 2007 at 03:50:20PM -0300, Jo??o Paulo Zavanela wrote:
> > How many fields is recomended to create a primary key?
> > I'm thinking to create one with 6 fields, is much?
>
> Normally a primary key would just be a single column.

Uhmm no. Normally a primary key is defined by the number of columns it
takes to determine naturally distinct values.

I would agree that if he is looking at 6 then he probably needs to
normalize further.

Sincerely,

Joshua D. Drake

- --

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 24x7/Emergency: +1.800.492.2240
PostgreSQL solutions since 1997 http://www.commandprompt.com/
UNIQUE NOT NULL
Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate
PostgreSQL Replication: http://www.commandprompt.com/products/

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHPej7ATb/zqfZUUQRAjnAAJ4p8mH685V/ysBDd4sPLoUkDRSzfACffFhs
AkUg+htYb3Nv2wpN/0ecod8=
=hnSU
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Ron Johnson 2007-11-16 19:01:19 Re: Primary Key
Previous Message Sam Mason 2007-11-16 18:54:22 Re: Primary Key