提交 e1b8a55e 编写于 作者: T Tom Lane

Remove caveat about avoiding cross-type operators in constraints intended

for use with constraint exclusion.  We can prove those cases now...
上级 c99ddfc4
<!-- $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>
......@@ -2784,29 +2784,6 @@ EXPLAIN SELECT count(*) FROM measurement WHERE logdate &gt;= DATE '2006-01-01';
</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
&mdash; 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册