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 E11A511F72A6 for ; Mon, 3 Apr 2006 00:43:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13870-02 for ; Mon, 3 Apr 2006 00:43:39 -0300 (ADT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id F002F11F63E8 for ; Mon, 3 Apr 2006 00:43:38 -0300 (ADT) Received: from haylee.gendns10.com (haylee.gendns10.com [216.180.234.5]) by svr4.postgresql.org (Postfix) with ESMTP id A0BBC5AF86C for ; Mon, 3 Apr 2006 03:43:38 +0000 (GMT) Received: from pool-71-98-166-169.tampfl.dsl-w.verizon.net ([71.98.166.169] helo=sherman.mars.lan) by haylee.gendns10.com with esmtp (Exim 4.52) id 1FQFya-0003Ow-OI for pgsql-sql@postgresql.org; Sun, 02 Apr 2006 23:43:36 -0400 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by sherman.mars.lan (Postfix) with ESMTP id B997156D9E for ; Sun, 2 Apr 2006 23:43:34 -0400 (EDT) Message-ID: <443099E6.3070101@quillandmouse.com> Date: Sun, 02 Apr 2006 23:43:34 -0400 From: Paul M Foster Reply-To: paulf@quillandmouse.com User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: References NULL field Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - haylee.gendns10.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [0 0] / [47 12] X-AntiAbuse: Sender Address Domain - quillandmouse.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.047 required=5 tests=[AWL=-0.189, RCVD_IN_SORBS_WEB=1.236] X-Spam-Score: 1.047 X-Spam-Level: * X-Archive-Number: 200604/8 X-Sequence-Number: 24817 This is PostgreSQL 7.4 (long story). I have a table, registrars, which has, among other things, note_id integer references notes The notes table has, among other things, note_id integer default nextval('notes_seq') Right now, there's nothing in the notes table, and all the records in the registrars table have null for their note_id field. I want to do a query (in PHP, FWIW) that returns all the fields in registrars, and the contents of any relevant notes records, or null for those fields if there is no corresponding record in the notes table. But when I do SELECT * FROM registrars, notes WHERE regname = 'blah' no matter that I put after the 'blah' (or nothing), I get no results. As soon as I add notes into the tables being queried, I get nothing. There's some special way I need to shape this query, but I don't know what it is. Any help would be appreciated. -- Paul M. Foster