diff options
Diffstat (limited to 'src/backend/optimizer/util/plancat.c')
| -rw-r--r-- | src/backend/optimizer/util/plancat.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index 7c4cd8a7f9..bd3a0c4a0a 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -1209,7 +1209,7 @@ get_relation_constraints(PlannerInfo *root, */ cexpr = eval_const_expressions(root, cexpr); - cexpr = (Node *) canonicalize_qual((Expr *) cexpr); + cexpr = (Node *) canonicalize_qual((Expr *) cexpr, true); /* Fix Vars to have the desired varno */ if (varno != 1) @@ -1262,11 +1262,13 @@ get_relation_constraints(PlannerInfo *root, if (pcqual) { /* - * Run each expression through const-simplification and - * canonicalization similar to check constraints. + * Run the partition quals through const-simplification similar to + * check constraints. We skip canonicalize_qual, though, because + * partition quals should be in canonical form already; also, since + * the qual is in implicit-AND format, we'd have to explicitly convert + * it to explicit-AND format and back again. */ pcqual = (List *) eval_const_expressions(root, (Node *) pcqual); - pcqual = (List *) canonicalize_qual((Expr *) pcqual); /* Fix Vars to have the desired varno */ if (varno != 1) |
