Re: Help with a foreign key with non-unique reference?

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Brent Wood <b(dot)wood(at)niwa(dot)co(dot)nz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Help with a foreign key with non-unique reference?
Date: 2008-09-16 17:20:20
Message-ID: 20080916101610.Y70889@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 16 Sep 2008, Brent Wood wrote:

> I need a foreign key (or equivalent) where the referenced table cannot
> have a unique constraint.

Well, do you need a full foreign key or just the insert-time check on the
referencing table? Does the referenced table get updates or deletes that
you want to watch for, and do you want those to error or to do the
equivalent of one of the referential actions?

For the insert-time check only if you don't care about deletes or updates
to the referenced table, a trigger that checks for existance is probably
good enough.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Browne 2008-09-16 17:25:36 Re: [LIKELY_SPAM]Re: Oracle and Postgresql
Previous Message Alan Hodgson 2008-09-16 17:18:00 Re: PITR and base + full backups