Re: Primary Key

From: Sam Mason <sam(at)samason(dot)me(dot)uk>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Primary Key
Date: 2007-11-16 18:54:22
Message-ID: 20071116185422.GY1955@frubble.xen.chris-lamb.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

  • Primary Key at 2007-11-16 18:50:20 from João Paulo Zavanela

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2007-11-16 19:01:15 Re: Primary Key
Previous Message João Paulo Zavanela 2007-11-16 18:50:20 Primary Key