|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.69 2006/11/2801:09:01 tgl Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.70 2006/12/2820:02:38 tgl Exp $ --> |
2 | 2 |
|
3 | 3 | <chapter id="ddl">
|
4 | 4 | <title>Data Definition</title>
|
@@ -2784,29 +2784,6 @@ EXPLAIN SELECT count(*) FROM measurement WHERE logdate >= DATE '2006-01-01';
|
2784 | 2784 | </para>
|
2785 | 2785 | </listitem>
|
2786 | 2786 |
|
2787 |
| - <listitem> |
2788 |
| - <para> |
2789 |
| - Avoid cross-data type comparisons in the <literal>CHECK</> |
2790 |
| - constraints, as the planner will currently fail to prove such |
2791 |
| - conditions false. For example, the following constraint |
2792 |
| - will work if <varname>x</varname> is an <type>integer</type> |
2793 |
| - column, but not if <varname>x</varname> is a |
2794 |
| - <type>bigint</type>: |
2795 |
| -<programlisting> |
2796 |
| -CHECK ( x = 1 ) |
2797 |
| -</programlisting> |
2798 |
| - For a <type>bigint</type> column we must use a constraint like: |
2799 |
| -<programlisting> |
2800 |
| -CHECK ( x = 1::bigint ) |
2801 |
| -</programlisting> |
2802 |
| - The problem is not limited to the <type>bigint</type> data type |
2803 |
| - — it can occur whenever the default data type of the |
2804 |
| - constant does not match the data type of the column to which it |
2805 |
| - is being compared. Cross-data type comparisons in the supplied |
2806 |
| - queries are usually OK, just not in the <literal>CHECK</> conditions. |
2807 |
| - </para> |
2808 |
| - </listitem> |
2809 |
| - |
2810 | 2787 | <listitem>
|
2811 | 2788 | <para>
|
2812 | 2789 | All constraints on all partitions of the master table are considered for
|
|