Re: Each foo must have a bar - Mailing list pgsql-general

From Michael Fuhr
Subject Re: Each foo must have a bar
Date
Msg-id 20060211215948.GA61030@winnie.fuhr.org
Whole thread Raw
In response to Each foo must have a bar  (David Fetter <david@fetter.org>)
Responses Re: Each foo must have a bar  (David Fetter <david@fetter.org>)
Re: Each foo must have a bar  (Michael Glaesemann <grzm@myrealbox.com>)
Re: Each foo must have a bar  (Michael Glaesemann <grzm@myrealbox.com>)
List pgsql-general
On Sat, Feb 11, 2006 at 12:56:36PM -0800, David Fetter wrote:
> I'm trying to figure out how to enforce the following.  Table foo has
> a primary key.  Table bar has a foreign key to foo.  So far so good.
> I'd also like to say, "for each row in foo, there must be at least one
> row in bar."

Possibly something involving CREATE CONSTRAINT TRIGGER, specifying
DEFERRABLE INITIALLY DEFERRED?  The documentation says it's not for
general use; I've used it only in simple experiments so I'm not
sure how problematic it could be.  Anybody?

--
Michael Fuhr

pgsql-general by date:

Previous
From: David Fetter
Date:
Subject: Each foo must have a bar
Next
From: David Fetter
Date:
Subject: Re: Each foo must have a bar