Skip to content

Commit e1b8a55

Browse files
committed
Remove caveat about avoiding cross-type operators in constraints intended
for use with constraint exclusion. We can prove those cases now...
1 parent c99ddfc commit e1b8a55

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

doc/src/sgml/ddl.sgml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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 &gt;= 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-
&mdash; 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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy