File tree Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Expand file tree Collapse file tree 1 file changed +1
-24
lines changed Original file line number Diff line number Diff line change 1- <!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.69 2006/11 /28 01:09:01 tgl Exp $ -->
1+ <!-- $PostgreSQL: pgsql/doc/src/sgml/ddl.sgml,v 1.70 2006/12 /28 20:02:38 tgl Exp $ -->
22
33<chapter id="ddl">
44 <title>Data Definition</title>
@@ -2784,29 +2784,6 @@ EXPLAIN SELECT count(*) FROM measurement WHERE logdate >= DATE '2006-01-01';
27842784 </para>
27852785 </listitem>
27862786
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-
28102787 <listitem>
28112788 <para>
28122789 All constraints on all partitions of the master table are considered for
You can’t perform that action at this time.
0 commit comments