null foreign key column - Mailing list pgsql-sql

From Arunachalam Jaisankar
Subject null foreign key column
Date
Msg-id 000801c2d181$6c0be360$020000c0@singlarc01
Whole thread Raw
Responses Re: null foreign key column  (Bruno Wolff III <bruno@wolff.to>)
Re: null foreign key column  (Dmitry Tkach <dmitry@openratings.com>)
List pgsql-sql
Hi all,
 
I would like to have a foreign key column in my table which allows null value also.
But the below create table sql command doesn't accept null value for person_id.
How to do in postgres?
 
create table event
(
    event_id               serial                not null,
    event_description      char(255)                     ,
    person_id              serial                        ,
    primary key (event_id),
    foreign key  (person_id)
       references person (person_id)
);
 
regards
Jai

pgsql-sql by date:

Previous
From: Daniel Jaenecke
Date:
Subject: timestamp
Next
From: "Eduardo"
Date:
Subject: PL/PGSQL TUTORIAL