Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit e11cfa8

Browse files
committed
Remove a sanity check in the exclusion-constraint code that prevented users
from defining non-self-conflicting constraints. Jeff Davis Note: I (tgl) objected to removing this check in 9.0 on the grounds that it was an important sanity check in new, poorly tested code. However, it should be all right to remove it for 9.1, since we'll get field testing from the 9.0 branch.
1 parent 8514bf4 commit e11cfa8

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/backend/executor/execUtils.c

+6-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.173 2010/07/06 19:18:56 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.174 2010/07/16 00:45:30 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1309,16 +1309,12 @@ check_exclusion_constraint(Relation heap, Relation index, IndexInfo *indexInfo,
13091309
index_endscan(index_scan);
13101310

13111311
/*
1312-
* We should have found our tuple in the index, unless we exited the loop
1313-
* early because of conflict. Complain if not. If we ever implement '<>'
1314-
* index opclasses, this check will fail and will have to be removed.
1312+
* Ordinarily, at this point the search should have found the originally
1313+
* inserted tuple, unless we exited the loop early because of conflict.
1314+
* However, it is possible to define exclusion constraints for which
1315+
* that wouldn't be true --- for instance, if the operator is <>.
1316+
* So we no longer complain if found_self is still false.
13151317
*/
1316-
if (!found_self && !conflict)
1317-
ereport(ERROR,
1318-
(errcode(ERRCODE_INTERNAL_ERROR),
1319-
errmsg("failed to re-find tuple within index \"%s\"",
1320-
RelationGetRelationName(index)),
1321-
errhint("This may be because of a non-immutable index expression.")));
13221318

13231319
econtext->ecxt_scantuple = save_scantuple;
13241320

0 commit comments

Comments
 (0)