-<!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.69 2006/11/28 01:09:01 tgl Exp $ -->
+<!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.70 2006/12/28 20:02:38 tgl Exp $ -->
<chapter id="ddl">
<title>Data Definition</title>
</para>
</listitem>
- <listitem>
- <para>
- Avoid cross-data type comparisons in the <literal>CHECK</>
- constraints, as the planner will currently fail to prove such
- conditions false. For example, the following constraint
- will work if <varname>x</varname> is an <type>integer</type>
- column, but not if <varname>x</varname> is a
- <type>bigint</type>:
-<programlisting>
-CHECK ( x = 1 )
-</programlisting>
- For a <type>bigint</type> column we must use a constraint like:
-<programlisting>
-CHECK ( x = 1::bigint )
-</programlisting>
- The problem is not limited to the <type>bigint</type> data type
- — it can occur whenever the default data type of the
- constant does not match the data type of the column to which it
- is being compared. Cross-data type comparisons in the supplied
- queries are usually OK, just not in the <literal>CHECK</> conditions.
- </para>
- </listitem>
-
<listitem>
<para>
All constraints on all partitions of the master table are considered for