Re: Primary Key - Mailing list pgsql-general

From Sam Mason
Subject Re: Primary Key
Date
Msg-id 20071116185422.GY1955@frubble.xen.chris-lamb.co.uk
Whole thread Raw
In response to Primary Key  (João Paulo Zavanela <joao_zava@globo.com>)
Responses Re: Primary Key  ("Joshua D. Drake" <jd@commandprompt.com>)
Re: Primary Key  (Ron Johnson <ron.l.johnson@cox.net>)
List pgsql-general
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.


  Sam

pgsql-general by date:

Previous
From: João Paulo Zavanela
Date:
Subject: Primary Key
Next
From: "Joshua D. Drake"
Date:
Subject: Re: Primary Key