Re: Check Constraints and pg_dump

Поиск
Список
Период
Сортировка
От Curt Sampson
Тема Re: Check Constraints and pg_dump
Дата
Msg-id Pine.NEB.4.58.0403030823490.5580@angelic-vtfw.cvpn.cynic.net
обсуждение исходный текст
Ответ на Re: Check Constraints and pg_dump  (Robert Treat <xzilla@users.sourceforge.net>)
Список pgsql-hackers
On Tue, 2 Mar 2004, Robert Treat wrote:

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

Unfortunately, it appears that an FK must reference a unique column. So this:
   ALTER TABLE contract ADD CONSTRAINT contract_must_have_a_plan       FOREIGN KEY ( contract_id ) REFERENCES plan (
contract_id)       INITIALLY DEFERRED;
 

produces the error message:
   UNIQUE constraint matching given keys for referenced table "plan" not found

Since a plan may have more than one contract.

cjs
-- 
Curt Sampson  <cjs@cynic.net>   +81 90 7737 2974   http://www.NetBSD.org   Don't you know, in this new Dark Age, we're
alllight.  --XTC
 


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

Предыдущее
От: "Simon Riggs"
Дата:
Сообщение: Re: Out of space situation and WAL log pre-allocation (was Tablespaces)
Следующее
От: 帅猛
Дата:
Сообщение: docs on tsearch2