From f213131f2024bcb85aea7d2a7dfadef6a0ee1b31 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 28 Sep 2006 20:51:43 +0000 Subject: Fix IS NULL and IS NOT NULL tests on row-valued expressions to conform to the SQL spec, viz IS NULL is true if all the row's fields are null, IS NOT NULL is true if all the row's fields are not null. The former coding got this right for a limited number of cases with IS NULL (ie, those where it could disassemble a ROW constructor at parse time), but was entirely wrong for IS NOT NULL. Per report from Teodor. I desisted from changing the behavior for arrays, since on closer inspection it's not clear that there's any support for that in the SQL spec. This probably needs more consideration. --- doc/src/sgml/func.sgml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index b3fe74fe502..978309d59ea 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ - + Functions and Operators @@ -338,6 +338,19 @@ + + + If the expression is row-valued, then + 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. + + + IS DISTINCT FROM -- cgit v1.2.3