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

Re: FOREIGN KEY AND INDEXEX

From: Alan Hodgson <ahodgson(at)simkin(dot)ca>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: FOREIGN KEY AND INDEXEX
Date: 2008-10-28 21:26:43
Message-ID: 200810281426.43844@hal.medialogik.com (view raw or flat)
Thread:
Lists: pgsql-novice
On Tuesday 28 October 2008, "JORGE MALDONADO" <jorgemal1960(at)gmail(dot)com> 
wrote:
> I need to define an index for a table but such an index already exists as
> a foreign key.
> I have fk_state (a foreign key) and I need a common index (ix_state).
> Should I define the index or does the foreign key work like an index too?

You need the index. Primary keys and unique constraints are implemented as 
indexes, but not foreign keys.

-- 
Alan

In response to

pgsql-novice by date

Next:From: Marcin KrolDate: 2008-10-29 13:37:50
Subject: the cost of logging statements
Previous:From: JORGE MALDONADODate: 2008-10-28 20:04:17
Subject: FOREIGN KEY AND INDEXEX

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