From: Paul Lambert <paul.lambert@autoledgers.com.au>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-sql <pgsql-sql@postgresql.org>
Subject: Re: Quick question re foreign keys.
Date: Wed, 24 Oct 2007 11:00:47 +0800
Message-ID: <471EB55F.5050600@autoledgers.com.au> (raw)
In-Reply-To: <21715.1193193880@sss.pgh.pa.us>
References: <471EA7D5.9040403@autoledgers.com.au>
<21715.1193193880@sss.pgh.pa.us>
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
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: paul.lambert@autoledgers.com.au, tgl@sss.pgh.pa.us
Subject: Re: Quick question re foreign keys.
In-Reply-To: <471EB55F.5050600@autoledgers.com.au>
* 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