null foreign key column

From: "Arunachalam Jaisankar" <jsankar(at)xtra(dot)co(dot)nz>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: null foreign key column
Date: 2003-02-11 03:55:28
Message-ID: 000801c2d181$6c0be360$020000c0@singlarc01
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Rafal Kedziorski 2003-02-11 09:16:15 which type for primary key?
Previous Message Eduardo 2003-02-10 23:53:13 PL/PGSQL TUTORIAL