pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Arunachalam Jaisankar <jsankar@xtra.co.nz>
To: pgsql-sql@postgresql.org
Subject: null foreign key column
Date: Tue, 11 Feb 2003 16:55:28 +1300
Message-ID: <000801c2d181$6c0be360$020000c0@singlarc01> (raw)

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

view thread (6+ messages)  latest in thread

Message-ID: <000801c2d181$6c0be360$020000c0@singlarc01>
Permalink:  ../000801c2d181$6c0be360$020000c0@singlarc01/
Also on:    postgresql.org/message-id/000801c2d181$6c0be360$020000c0@singlarc01

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: jsankar@xtra.co.nz
  Subject: Re: null foreign key column
  In-Reply-To: <000801c2d181$6c0be360$020000c0@singlarc01>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox