pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruno Wolff III <bruno@wolff.to>
To: Matt Clark <matt@ymogen.net>
Cc: Rod Taylor <pg@rbt.ca>
Cc: Ulrich Wisser <ulrich.wisser@relevanttraffic.se>
Cc: gnari <gnari@simnet.is>
Cc: Postgresql Performance <pgsql-performance@postgresql.org>
Subject: Re: insert
Date: Fri, 13 Aug 2004 11:31:34 -0500
Message-ID: <20040813163134.GA3743@wolff.to> (raw)
In-Reply-To: <006901c48150$fcfafb10$8300a8c0@solent>
References: <20040813150243.GA2004@wolff.to>
	<006901c48150$fcfafb10$8300a8c0@solent>

On Fri, Aug 13, 2004 at 17:17:10 +0100,
  Matt Clark <matt@ymogen.net> wrote:
> > > It is likely that you are missing an index on one of those foreign 
> > > key'd items.
> > 
> > I don't think that is too likely as a foreign key reference 
> > must be a unique key which would have an index. 
> 
> I think you must be thinking of primary keys, not foreign keys.  All
> one-to-many relationships have non-unique foreign keys.

The target of the reference needs to have at least a unique index.
I am not sure if it needs to actually be declared as either a unique
or primary key, though that is the intention.

The records doing the referencing don't need (and normally aren't)
unique.



view thread (19+ messages)  latest in thread

Message-ID: <20040813163134.GA3743@wolff.to>
Permalink:  ../20040813163134.GA3743@wolff.to/
Also on:    postgresql.org/message-id/20040813163134.GA3743@wolff.to

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: bruno@wolff.to, matt@ymogen.net, pg@rbt.ca, ulrich.wisser@relevanttraffic.se, gnari@simnet.is
  Subject: Re: insert
  In-Reply-To: <20040813163134.GA3743@wolff.to>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox