Re: Check Constraints and pg_dump

Поиск
Список
Период
Сортировка
От Robert Treat
Тема Re: Check Constraints and pg_dump
Дата
Msg-id 200403020945.03031.xzilla@users.sourceforge.net
обсуждение исходный текст
Ответ на Re: Check Constraints and pg_dump  (Curt Sampson <cjs@cynic.net>)
Ответы Re: Check Constraints and pg_dump  (Bruno Wolff III <bruno@wolff.to>)
Re: Check Constraints and pg_dump  (Curt Sampson <cjs@cynic.net>)
Список pgsql-hackers
On Monday 01 March 2004 22:59, Curt Sampson wrote:
> On Mon, 1 Mar 2004, Tom Lane wrote:
> > Curt Sampson <cjs@cynic.net> writes:
> > > Can you explain how to do this? There is no reference to a plan in the
> > > contract table; the constraint just checks to see that, if a contract
> > > exists, there is at least one plan referencing that contract.
> > > There is of course a foreign key constraint used in the plan table to
> > > make sure that the contract exists.
> >
> > If so, how would it be possible to create a plan before creating the
> > contract?  I don't think the OP's requirements are clearly thought out.
>
> You create the contract and its first plan at the same time, inserting
> the plan first. It works fine.
>
<snip>
> > In the meantime, if what's wanted is a one-time check at row insertion,
> > the right way to express that behavior is with an ON INSERT trigger.
>
> That's not an adequate check; it would allow you later to delete the
> plan without deleting the contract.
>

Wouldn't a FK on both tables be the appropriate schema?  With the FK on 
contract being deffered?

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


В списке pgsql-hackers по дате отправления:

Предыдущее
От: ivan
Дата:
Сообщение: Re: lib for clients
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: [PATCHES] Foreign key type checking patch