diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
new file mode 100644
index 00f8ffb..51bfe31
*** a/doc/src/sgml/func.sgml
--- b/doc/src/sgml/func.sgml
***************
*** 351,357 ****
      for both tests.
      This definition conforms to the SQL standard, and is a change from the
      inconsistent behavior exhibited by <productname>PostgreSQL</productname>
!     versions prior to 8.2.
     </para>
    </note>
  
--- 351,359 ----
      for both tests.
      This definition conforms to the SQL standard, and is a change from the
      inconsistent behavior exhibited by <productname>PostgreSQL</productname>
!     versions prior to 8.2.  Row expressions inside row 
!     expressions are processed as non-null, even if the sub-row contains only
!     nulls.
     </para>
    </note>
  
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c
new file mode 100644
index 76c032c..ce7047f
*** a/src/backend/optimizer/util/clauses.c
--- b/src/backend/optimizer/util/clauses.c
*************** eval_const_expressions_mutator(Node *nod
*** 3100,3109 ****
  								return makeBoolConst(false, false);
  							continue;
  						}
  						newntest = makeNode(NullTest);
  						newntest->arg = (Expr *) relem;
  						newntest->nulltesttype = ntest->nulltesttype;
! 						newntest->argisrow = type_is_rowtype(exprType(relem));
  						newargs = lappend(newargs, newntest);
  					}
  					/* If all the inputs were constants, result is TRUE */
--- 3100,3124 ----
  								return makeBoolConst(false, false);
  							continue;
  						}
+ 						/* Do we have a ROW() expression in the row? */
+ 						if (type_is_rowtype(exprType(relem)))
+ 						{
+ 							/*
+ 							 * ROW values in ROW values are not null, even if
+ 							 * those sub-ROW values contain only nulls.  This
+ 							 * makes the code match PL/pgSQL and constraint
+ 							 * IS NULL checks which don't probe into sub-ROWs
+ 							 * for NULL values.
+ 							 */							
+ 							if (ntest->nulltesttype == IS_NULL)
+ 								return makeBoolConst(false, false);
+ 							continue;
+ 						}
+ 
  						newntest = makeNode(NullTest);
  						newntest->arg = (Expr *) relem;
  						newntest->nulltesttype = ntest->nulltesttype;
! 						newntest->argisrow = false;
  						newargs = lappend(newargs, newntest);
  					}
  					/* If all the inputs were constants, result is TRUE */
