X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 73D4CD1C931 for ; Thu, 24 Jul 2003 23:24:34 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 81203-06 for ; Thu, 24 Jul 2003 20:23:51 -0300 (ADT) Received: from mailav.tor1.inquent.com (mail.inquent.com [216.208.117.106]) by svr1.postgresql.org (Postfix) with ESMTP id B38BAD1C946 for ; Thu, 24 Jul 2003 20:24:32 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mailav.tor1.inquent.com (Postfix) with ESMTP id 5D1CB10259; Thu, 24 Jul 2003 19:17:30 -0400 (EDT) Received: from [192.168.1.200] (dyn-133-81.tor.dsl.tht.net [134.22.133.81]) by mailav.tor1.inquent.com (Postfix) with ESMTP id EEF011024D; Thu, 24 Jul 2003 19:17:27 -0400 (EDT) Subject: Re: silly NULL question From: Rod Taylor To: Dan Weeks Cc: pgsql-sql@postgresql.org In-Reply-To: <16160.26749.931319.656882@underdog.wildbrain.com> References: <16160.26749.931319.656882@underdog.wildbrain.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-BgJb4fTsD+72jtq6QdnP" Message-Id: <1059089115.90090.8.camel@jester> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.3 Date: 24 Jul 2003 19:25:16 -0400 X-Virus-Scanned: by AMaViS perl-11 X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200307/367 X-Sequence-Number: 14481 --=-BgJb4fTsD+72jtq6QdnP Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > Would return the row. Now with an upgrade to PostgreSQL 7.3 (yes, I know > there are many changes and we're working through them right now) the same > query returns nothing. Dropping the "AND parent_id =3D NULL" returns the= row > as expected. NULL is similar to UNKNOWN. So, NULL =3D NULL is the similar to UNKNOWN =3D UNKNOWN. Since you don't know it, how can you tell if they're equal or not? Syntax you're looking for is: AND parent_id IS NULL If you really really really need =3D NULL (due to some MS product which ignores SQL standards -- say MS Access) there is a toggle in the postgresql.conf file to allow automated conversion of =3D NULL to IS NULL within the server. --=-BgJb4fTsD+72jtq6QdnP Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (FreeBSD) iD8DBQA/IGra6DETLow6vwwRAmSzAJ9SZbssiDZjaYz7ouGWqhnuq+mv2wCfeILk 8U02gTGOgM2vfRt2zioxaRQ= =Ey4M -----END PGP SIGNATURE----- --=-BgJb4fTsD+72jtq6QdnP--