X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 5C0F79DCBE3 for ; Tue, 6 Dec 2005 11:02:30 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 24293-04 for ; Tue, 6 Dec 2005 11:02:34 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id D58439DCB0B for ; Tue, 6 Dec 2005 11:02:27 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.1/8.13.1) with ESMTP id jB6F2VWB000228; Tue, 6 Dec 2005 10:02:31 -0500 (EST) To: mario.splivalo@mobart.hr cc: pgsql-sql@postgresql.org Subject: Re: JOIN query not working as expected In-reply-to: <1133881258.8161.28.camel@ekim> References: <1133878084.8161.22.camel@ekim> <164.1133881091@sss.pgh.pa.us> <1133881258.8161.28.camel@ekim> Comments: In-reply-to Mario Splivalo message dated "Tue, 06 Dec 2005 16:00:58 +0100" Date: Tue, 06 Dec 2005 10:02:31 -0500 Message-ID: <227.1133881351@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.003 required=5 tests=[AWL=0.003] X-Spam-Score: 0.003 X-Spam-Level: X-Archive-Number: 200512/42 X-Sequence-Number: 23584 Mario Splivalo writes: > I can create a FK on a column wich allows NULL values, and I can even > insert rows with NULLs in FK column, although PK table where FK is > pointing does not allow nuls. Is that 'by design', or...? It's per SQL spec. Add a NOT NULL constraint to the column if you do not wish to allow NULLs. regards, tom lane