Re: Foreign Key Non-Null Problem in 8.0 - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: Foreign Key Non-Null Problem in 8.0
Date
Msg-id 20041030232032.D96785@megazone.bigpanda.com
Whole thread Raw
In response to Foreign Key Non-Null Problem in 8.0  ("Jon Uhal" <juhal@dawning.com>)
List pgsql-sql
On Wed, 27 Oct 2004, Jon Uhal wrote:

> I'm having trouble trying to get my databases setup so that when I
> delete a row from the base table, all related information is removed as
> well.  I've been testing this with PostgreSQL version (postmaster
> (PostgreSQL) 8.0.0beta1) on a Windows 2000 Pro machine.  I have been
> unsuccessful in trying to get the MATCH SIMPLE clause of CREATE TABLE to
> work and I was thinking it was because of how I had defined my tables.
> Every time I try to create a foreign key or reference into another
> table, postgres seems to make the column NOT NULL.  I have been unable
> to get it to allow nulls in the foriegn key column.

Actually, I think the problem is that you're defining the foreign columns
as serial (which appears to imply not null).  You probably want them to be
int4.


pgsql-sql by date:

Previous
From: Murphy Pope
Date:
Subject: Re: ORDER BY and NULLs
Next
From: nialllinden@yahoo.com (Niall Linden)
Date:
Subject: paertially restoring a DB