Re: BUG #2771: NULL values in FOREIGN KEY fields - Mailing list pgsql-bugs

From Jaime Casanova
Subject Re: BUG #2771: NULL values in FOREIGN KEY fields
Date
Msg-id c2d9e70e0611201803g7d630698ibf1572ec586aa85@mail.gmail.com
Whole thread Raw
In response to BUG #2771: NULL values in FOREIGN KEY fields  ("vincent" <vincent@iim.nctu.edu.tw>)
List pgsql-bugs
On 11/20/06, vincent <vincent@iim.nctu.edu.tw> wrote:
> When insert a null value in foreign key fields, an error occurs.
>
> CREATE TABLE TGroup (
>   C_Group_ID CHAR(8) NOT NULL,
>   C_Group_Name VARCHAR(50),
>   C_Group_Parent CHAR(8) NOT NULL,
>   CONSTRAINT TGroup_C_Group_Parent_fkey FOREIGN KEY (C_Group_Parent)

That's because your C_Group_Parent column has a Not Null constraint
and you can't insert null values in a Not Null columns

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
                                       Richard Cook

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #2759: \df doesn't show functions with no args
Next
From: Euler Taveira de Oliveira
Date:
Subject: Re: BUG #2771: NULL values in FOREIGN KEY fields