Skip site navigation (1) Skip section navigation (2)

Re: Dual Primary keys

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Bantamess" <bantamess(at)yahoo(dot)co(dot)uk>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Dual Primary keys
Date: 2004-02-04 16:22:06
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-novice
"Bantamess" <bantamess(at)yahoo(dot)co(dot)uk> writes:
> Hello can any body tell me how to code a table with dual primary keys?

Do you mean a two-column composite primary key?  Two independent primary
keys is nonsensical --- you should pick just one of them to be
considered the "primary" key.

If you want a composite primary key, the syntax is
	primary key (f1, f2)

			regards, tom lane

In response to

pgsql-novice by date

Next:From: Josh BerkusDate: 2004-02-04 17:31:46
Subject: Re: Dual Primary keys
Previous:From: Bruno Wolff IIIDate: 2004-02-04 15:35:18
Subject: Re: Dual Primary keys

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group