Received: from candle.pha.pa.us (216-55-132-35.dialup.tnt01.san-diego.abac.net [216.55.132.35]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBHH6Cm75777 for ; Mon, 17 Dec 2001 12:06:12 -0500 (EST) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id fBHH6Bh06057; Mon, 17 Dec 2001 12:06:11 -0500 (EST) From: Bruce Momjian Message-Id: <200112171706.fBHH6Bh06057@candle.pha.pa.us> Subject: Re: how could a foreign key ever be NULL? In-Reply-To: <8BBB36A0-F2E2-11D5-92F7-003065C2A10C@mac.com> "from Terrence Brannon at Dec 17, 2001 03:38:09 am" To: Terrence Brannon Date: Mon, 17 Dec 2001 12:06:10 -0500 (EST) CC: pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL90 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200112/182 X-Sequence-Number: 6006 > The Momjian book states: > > A single-column foreign key is either NULL or matches a primary key > > But the problem I have with this statement is that a primary key > cannot be null or duplicate. And since the foreign key references > a value that is neither null or duplicate, how could it ever be > NULL? Uh, you could have a foreign key row that doesn't match a primary key row, and is hence NULL, can't you? -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026