Re: Foreign Key Columns And Indices - Mailing list pgsql-hackers

From Roderick A. Anderson
Subject Re: Foreign Key Columns And Indices
Date
Msg-id Pine.LNX.4.10.10102041912350.19984-100000@tincan.org
Whole thread Raw
In response to Foreign Key Columns And Indices  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
On Mon, 5 Feb 2001, Christopher Kings-Lynne wrote:

> Just a quick question, when a column of a table is defined to be a foreign
> key, is it implicitly indexed, or does one still need to explicitly CREATE
> INDEX?

I don't think you can actually declare the column in the table as a
foreign key.  A foreign key is a column or columns in another table.  For
a single column in the other table I'm pretty sure that column must be
'not null' and 'unique'.  An index - other than to inforce uniqueness
(currently how it's done in PostgreSQL?) - has nothing to do with the
foreign key.  Being a mere mortal - not a demi-god of PostgreSQLness - this could be
an over simplification or totally out to lunch.


Rod
-- 



pgsql-hackers by date:

Previous
From: Philip Warner
Date:
Subject: Re: Foreign Key Columns And Indices
Next
From: m w
Date:
Subject: contrib