diff options
Diffstat (limited to 'doc/src')
| -rw-r--r-- | doc/src/sgml/func.sgml | 24 | ||||
| -rw-r--r-- | doc/src/sgml/runtime.sgml | 45 |
2 files changed, 60 insertions, 9 deletions
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml index 89a9bd1f8eb..0dc19768c1c 100644 --- a/doc/src/sgml/func.sgml +++ b/doc/src/sgml/func.sgml @@ -1,4 +1,4 @@ -<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.71 2001/09/10 02:46:18 ishii Exp $ --> +<!-- $Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.72 2001/09/20 14:20:26 petere Exp $ --> <chapter id="functions"> <title>Functions and Operators</title> @@ -266,16 +266,24 @@ Do <emphasis>not</emphasis> use <literal><replaceable>expression</replaceable> = NULL</literal> because NULL is not <quote>equal to</quote> NULL. (NULL represents - an unknown value, so it is not known whether two unknown values are - equal.) <productname>Postgres</productname> presently converts - <literal>x = NULL</literal> clauses to <literal>x IS NULL</literal> to - allow some broken client applications (such as - <productname>Microsoft Access</productname>) to work, but this may - be discontinued in a future release. + an unknown value, and it is not known whether two unknown values are + equal.) </para> <para> - Boolean values can be tested using the constructs + Some applications may (incorrectly) require that + <literal><replaceable>expression</replaceable> = NULL</literal> + returns true if <replaceable>expression</replaceable> evaluates to + the NULL value. To support these applications, the run-time option + <varname>transform_null_equals</varname> can be turned on (e.g., + <literal>SET transform_null_equals TO ON;</literal>). + <productname>PostgreSQL</productname> would then convert <literal>x + = NULL</literal> clauses to <literal>x IS NULL</literal>. This was + the default behavior in releases 6.5 through 7.1. + </para> + + <para> + Boolean values can also be tested using the constructs <synopsis> <replaceable>expression</replaceable> IS TRUE <replaceable>expression</replaceable> IS NOT TRUE diff --git a/doc/src/sgml/runtime.sgml b/doc/src/sgml/runtime.sgml index 2f277883346..eef78e17a35 100644 --- a/doc/src/sgml/runtime.sgml +++ b/doc/src/sgml/runtime.sgml @@ -1,5 +1,5 @@ <!-- -$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.80 2001/09/16 16:11:09 petere Exp $ +$Header: /cvsroot/pgsql/doc/src/sgml/runtime.sgml,v 1.81 2001/09/20 14:20:27 petere Exp $ --> <Chapter Id="runtime"> @@ -1202,6 +1202,49 @@ dynamic_library_path = '/usr/local/lib/postgresql:/home/my_project/lib:$libdir' </varlistentry> <varlistentry> + <term><varname>TRANSFORM_NULL_EQUALS</varname> (<type>boolean</type>)</term> + <listitem> + <para> + When turned on, expressions of the form + <literal><replaceable>expr</> = NULL</literal> (or + <literal>NULL = <replaceable>expr</></literal>) are treated as + <literal><replaceable>expr</> IS NULL</literal>, that is, they + return true if <replaceable>expr</> evaluates to the NULL + value, and false otherwise. The correct behavior of + <literal><replaceable>expr</> = NULL</literal> is to always + return NULL (unknown). Therefore this option defaults to off. + </para> + + <para> + However, filtered forms in <productname>Microsoft + Access</productname> generate queries that appear to use + <literal><replaceable>expr</> = NULL</literal> to test for + NULLs, so if you use that interface to access the database you + might want to turn this option on. Since expressions of the + form <literal><replaceable>expr</> = NULL</literal> always + return NULL (using the correct interpretation) they are not + very useful and do not appear often in normal applications, so + this option does little harm in practice. But new users are + frequently confused about the semantics of expressions + involving NULL, so we do not turn this option on by default. + </para> + + <para> + Note that this option only affects the literal <literal>=</> + operator, not other comparison operators or other expressions + that are computationally equivalent to some expression + involving the equals operator (such as <literal>IN</literal>). + Thus, this option is not a general fix for bad programming. + </para> + + <para> + Refer to the <citetitle>User's Guide</citetitle> for related + information. + </para> + </listitem> + </varlistentry> + + <varlistentry> <term><varname>PORT</varname> (<type>integer</type>)</term> <listitem> <para> |
