Details for ROW IS NULL test

View: New views
1 Messages — Rating Filter:   Alert me  

Details for ROW IS NULL test

by Bruce Momjian-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I found the row handling for "IS [NOT] NULL" confusing for row-valued
expressions, so I added the attached documentation sentence.

--
  Bruce Momjian  <bruce@...>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

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 ****
      <literal>IS NULL</> is true when the row expression itself is null
      or when all the row's fields are null, while
      <literal>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 <productname>PostgreSQL</productname>
      versions prior to 8.2.
--- 344,354 ----
      <literal>IS NULL</> is true when the row expression itself is null
      or when all the row's fields are null, while
      <literal>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,
!     <literal>IS NULL</> and <literal>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 <productname>PostgreSQL</productname>
      versions prior to 8.2.


--
Sent via pgsql-docs mailing list (pgsql-docs@...)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs
LightInTheBox - Buy quality products at wholesale price!