pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Sullivan <ajs@crankycanuck.ca>
To: pgsql-sql@postgresql.org
Subject: Re: select based on multi-column primary keys
Date: Sun, 21 Jan 2007 10:28:38 -0500
Message-ID: <20070121152838.GB3533@phlogiston.dyndns.org> (raw)
In-Reply-To: <eos326$13fv$1@news.hub.org>
References: <45B16602.2080508@furthernorth.net>
	<eos326$13fv$1@news.hub.org>

On Fri, Jan 19, 2007 at 07:45:40PM -0800, codeWarrior wrote:
> AFAIK: You cannot have multiple primary keys. How would you know which one 
> is the actual key ?

You can have a multi-column primary key, though.  That's a perfectly
legitimate approach.

> FYI: What you are really talking about are table contraints... When you have 

No, it's a multi-column primary key.

> My advice would be to alter your table structure so that you have a "real" 
> PK not table constraints -- that would make it searchable....

This is already searchable.  What you are talking about is not a real
primary key, but an artificial one.  The OP already has a real
primary key.  SQL purists think artificial primary keys mean that you
haven't done enough normalisation.  I'm going to remain silent on
that topic, though, so that we don't get a Thread That Does Not End
:)

A


-- 
Andrew Sullivan  | ajs@crankycanuck.ca
If they don't do anything, we don't need their acronym.
		--Josh Hamilton, on the US FEMA



view thread (7+ messages)  latest in thread

Message-ID: <20070121152838.GB3533@phlogiston.dyndns.org>
Permalink:  ../20070121152838.GB3533@phlogiston.dyndns.org/
Also on:    postgresql.org/message-id/20070121152838.GB3533@phlogiston.dyndns.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: ajs@crankycanuck.ca
  Subject: Re: select based on multi-column primary keys
  In-Reply-To: <20070121152838.GB3533@phlogiston.dyndns.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox