mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-07 19:47:50 +08:00
Remove caveat about avoiding cross-type operators in constraints intended
for use with constraint exclusion. We can prove those cases now...
This commit is contained in:
parent
c99ddfc43d
commit
e1b8a55ec8
@ -1,4 +1,4 @@
|
||||
<!-- $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 >= 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
|
||||
— 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
|
||||
|
Loading…
Reference in New Issue
Block a user