Re: Foreign Key Non-Null Problem in 8.0

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Jon Uhal <juhal(at)dawning(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Foreign Key Non-Null Problem in 8.0
Date: 2004-10-31 06:22:00
Message-ID: 20041030232032.D96785@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Iain 2004-11-01 05:51:33 Re: paertially restoring a DB
Previous Message Murphy Pope 2004-10-31 00:00:25 Re: ORDER BY and NULLs