Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 253962E003C for ; Sun, 6 Apr 2008 21:51:35 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 27950-09 for ; Sun, 6 Apr 2008 21:51:31 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from momjian.us (momjian.us [70.90.9.53]) by developer.postgresql.org (Postfix) with ESMTP id ABCED2E0038 for ; Sun, 6 Apr 2008 21:51:31 -0300 (ADT) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id m370pXB07984 for pgsql-docs@postgresql.org; Sun, 6 Apr 2008 20:51:33 -0400 (EDT) From: Bruce Momjian Message-Id: <200804070051.m370pXB07984@momjian.us> Subject: Details for ROW IS NULL test To: PostgreSQL-documentation Date: Sun, 6 Apr 2008 20:51:33 -0400 (EDT) X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1207529493-23690-0_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200804/1 X-Sequence-Number: 4861 --ELM1207529493-23690-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" I found the row handling for "IS [NOT] NULL" confusing for row-valued expressions, so I added the attached documentation sentence. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + If your life is a hard drive, Christ can be your backup. + --ELM1207529493-23690-0_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/rtmp/diff" Index: doc/src/sgml/func.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/func.sgml,v retrieving revision 1.427 diff -c -c -r1.427 func.sgml *** doc/src/sgml/func.sgml 4 Apr 2008 18:45:36 -0000 1.427 --- doc/src/sgml/func.sgml 7 Apr 2008 00:46:46 -0000 *************** *** 344,350 **** IS NULL is true when the row expression itself is null or when all the row's fields are null, while IS NOT NULL is true when the row expression itself is non-null ! and all the row's fields are non-null. This definition conforms to the SQL standard, and is a change from the inconsistent behavior exhibited by PostgreSQL versions prior to 8.2. --- 344,354 ---- IS NULL is true when the row expression itself is null or when all the row's fields are null, while IS NOT NULL is true when the row expression itself is non-null ! and all the row's fields are non-null. Because of this behavior, ! IS NULL and IS NOT NULL do not always return ! inverse results for row-valued expressions, i.e. a row-valued ! expression that contains both NULL and non-null values will return false ! for both tests. This definition conforms to the SQL standard, and is a change from the inconsistent behavior exhibited by PostgreSQL versions prior to 8.2. --ELM1207529493-23690-0_--