Re: Primary Key

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Primary Key
Date: 2007-11-16 19:11:15
Message-ID: 20071116111115.052a7282@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 13:03:23 -0600
Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 11/16/07 12:54, Sam Mason 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. When you
> > start going to that many I'd probably have a serial column as the
> > primary key, and a UNIQUE index on those six fields. Depends on
> > what you're doing, though unless you've got a few years experience
> > I'd be tempted to stay away from primary keys of more than a single
> > column.
>
> Fie on you evil synthetic key lovers. Long live the Natural Key!

Right with you there buddy. Let's get the pitchforks!

Joshua D. Drake

>
> - --
> Ron Johnson, Jr.
> Jefferson LA USA
>
> %SYSTEM-F-FISH, my hovercraft is full of eels
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFHPel7S9HxQb37XmcRAmPZAJ9mml45XtPRSCrAiQ7K+LCwWf5J5QCgvaSp
> Zs5F1SU5CNQvnoofaxkAoIY=
> =9ipR
> -----END PGP SIGNATURE-----
>
> ---------------------------(end of
> broadcast)--------------------------- TIP 2: Don't 'kill -9' the
> postmaster
>

- --

=== 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)

iD8DBQFHPetVATb/zqfZUUQRAp29AJ49UhU3LWyaIJq+F/vCkrZIMBIi8QCdEesA
EqTIjelyYrqR8+JN1Y3sPwM=
=AlLT
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2007-11-16 19:14:21 Re: XML schema
Previous Message Ron Johnson 2007-11-16 19:03:23 Re: Primary Key