PK & FK & Index Question

From: L D <lenardd(at)hotmail(dot)com>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: PK & FK & Index Question
Date: 2007-09-02 21:12:06
Message-ID: BAY120-W14B9D62D95DF7DDBF8794BBBC80@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Hi All,

Assume the following have a one-to-one relationship:

team_contact
team_contact_id (PK)
first_name last_name
...

team_contact_contacts
team_contact_id (FK)
home_phone work_phone
...


Should I set the latter table's FK also to PK? If so, do I need to set an index on the FK even though it's also the primary key?

Alternatively, I could just add a UK contraint to FK and do away with PK, right?

Thanks.

--Lenard



_________________________________________________________________
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rodrigo De León 2007-09-02 21:20:51 Re: PK & FK & Index Questio
Previous Message Josh Tolley 2007-09-02 20:38:50 Re: pg & Delphi