Re: FK issue

From: Doug McNaught <doug(at)mcnaught(dot)org>
To: mike <mike(at)bristolreccc(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: FK issue
Date: 2004-06-10 15:45:22
Message-ID: 873c534dt9.fsf@asmodeus.mcnaught.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

mike <mike(at)bristolreccc(dot)co(dot)uk> writes:

> I have set up a FK as follows
>
> ALTER TABLE lk_sub_con ADD FOREIGN KEY (type) REFERENCES
> lk_sort_of_contact(type_code);
>
> However when I do this
>
> INSERT INTO lk_sort_of_contact (type_code) VALUES ('1') (ie: a NULL into
> the FK) it works
>
> Is this a bug?

No.

NULLs are permitted in referencing columns unless that column is
declared NOT NULL.

-Doug

In response to

  • FK issue at 2004-06-10 15:21:53 from mike

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2004-06-10 15:50:35 Re: encrypted passwords
Previous Message mike 2004-06-10 15:21:53 FK issue