mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.340 2006/09/22 16:20:00 tgl Exp $ -->
|
||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/func.sgml,v 1.341 2006/09/28 20:51:41 tgl Exp $ -->
|
||||
|
||||
<chapter id="functions">
|
||||
<title>Functions and Operators</title>
|
||||
@ -338,6 +338,19 @@
|
||||
</para>
|
||||
</tip>
|
||||
|
||||
<note>
|
||||
<para>
|
||||
If the <replaceable>expression</replaceable> is row-valued, then
|
||||
<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.
|
||||
</para>
|
||||
</note>
|
||||
|
||||
<para>
|
||||
<indexterm>
|
||||
<primary>IS DISTINCT FROM</primary>
|
||||
|
Reference in New Issue
Block a user