Re: Quick question re foreign keys.

From: Paul Lambert <paul(dot)lambert(at)autoledgers(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-sql <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Quick question re foreign keys.
Date: 2007-10-24 03:00:47
Message-ID: 471EB55F.5050600@autoledgers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Tom Lane wrote:
>
> If I'm understanding you correctly, the problem is not the foreign key,
> it's that you marked the column NOT NULL. A foreign key constraint by
> itself will allow a NULL in the referencing column to pass. You choose
> whether you want to allow that or not by separately applying a NOT NULL
> constraint or not.
>
> regards, tom lane

It's marked not null as a result of being part of the primary key for
that table which I can't really get around.

I can get away with not having the foreign key though, so I'll have to
go down that path.

Cheers,
P.

--
Paul Lambert
Database Administrator
AutoLedgers

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Paul Lambert 2007-10-24 03:09:27 Re: Quick question re foreign keys.
Previous Message Adrian Klaver 2007-10-24 02:51:18 Re: request for help with COPY syntax