Re: Each foo must have a bar

Поиск
Список
Период
Сортировка
От Michael Fuhr
Тема Re: Each foo must have a bar
Дата
Msg-id 20060211215948.GA61030@winnie.fuhr.org
обсуждение исходный текст
Ответ на Each foo must have a bar  (David Fetter <david@fetter.org>)
Ответы 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>)
Список 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 по дате отправления:

Предыдущее
От: David Fetter
Дата:
Сообщение: Each foo must have a bar
Следующее
От: David Fetter
Дата:
Сообщение: Re: Each foo must have a bar