Re: When to use compound PK instead of a FK?

From: Ron Johnson <ron(dot)l(dot)johnson(at)cox(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: When to use compound PK instead of a FK?
Date: 2007-02-06 05:21:18
Message-ID: 45C8104E.7010902@cox.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 02/04/07 09:48, Jamie wrote:
> I typically use compound primary keys when creating a table that
> represents a many-to-many relationship. I was wondering if anyone else
> had other situations in which you would use a compound PK? Why do you
> use it instead of just a foreign key?

We use multi-segment PKs all the time. Is that what you meant by
"compound PK"?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFFyBBOS9HxQb37XmcRAiVCAKC6OgW8uBrm5xE9idWrHjzIC/Vv9ACeOM3Q
ManPjPaX0eVo+TKmg6YvOQg=
=EEH9
-----END PGP SIGNATURE-----

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gurjeet Singh 2007-02-06 06:43:41 Re: Locking question?
Previous Message Gene 2007-02-05 21:31:53 Re: postgresql fails to start after symlinking pgdata dir