aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ruleutils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-12-28 21:57:37 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-12-28 21:57:37 +0000
commitc607bd693ffcf225b7ef696ca44b537076038854 (patch)
tree5284d0d0f9b8d671dedd379199bdbba114f8a352 /src/backend/utils/adt/ruleutils.c
parentd167fb10153a2f00c9a8b46df537a202f7755cb9 (diff)
downloadpostgresql-c607bd693ffcf225b7ef696ca44b537076038854.tar.gz
postgresql-c607bd693ffcf225b7ef696ca44b537076038854.zip
Clean up the usage of canonicalize_qual(): in particular, be consistent
about whether it is applied before or after eval_const_expressions(). I believe there were some corner cases where the system would fail to recognize that a partial index is applicable because of the previous inconsistency. Store normal rather than 'implicit AND' representations of constraints and index predicates in the catalogs. initdb forced due to representation change of constraints/predicates.
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r--src/backend/utils/adt/ruleutils.c25
1 files changed, 1 insertions, 24 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index ca3c3720519..f8937c7ea64 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -3,7 +3,7 @@
* back to source text
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.160 2003/11/29 19:51:59 pgsql Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/ruleutils.c,v 1.161 2003/12/28 21:57:37 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@@ -810,13 +810,6 @@ pg_get_indexdef_worker(Oid indexrelid, int colno, int prettyFlags)
node = (Node *) stringToNode(predString);
pfree(predString);
- /*
- * If top level is a List, assume it is an implicit-AND
- * structure, and convert to explicit AND. This is needed for
- * partial index predicates.
- */
- if (node && IsA(node, List))
- node = (Node *) make_ands_explicit((List *) node);
/* Deparse */
str = deparse_expression_pretty(node, context, false, false,
prettyFlags, 0);
@@ -1060,14 +1053,6 @@ pg_get_constraintdef_worker(Oid constraintId, int prettyFlags)
conbin = DatumGetCString(DirectFunctionCall1(textout, val));
expr = stringToNode(conbin);
- /*
- * If top level is a List, assume it is an implicit-AND
- * structure, and convert to explicit AND. This is needed
- * for partial index predicates.
- */
- if (expr && IsA(expr, List))
- expr = (Node *) make_ands_explicit((List *) expr);
-
/* Set up deparsing context for Var nodes in constraint */
if (conForm->conrelid != InvalidOid)
{
@@ -1212,14 +1197,6 @@ pg_get_expr_worker(text *expr, Oid relid, char *relname, int prettyFlags)
/* Convert expression to node tree */
node = (Node *) stringToNode(exprstr);
- /*
- * If top level is a List, assume it is an implicit-AND structure, and
- * convert to explicit AND. This is needed for partial index
- * predicates.
- */
- if (node && IsA(node, List))
- node = (Node *) make_ands_explicit((List *) node);
-
/* Deparse */
context = deparse_context_for(relname, relid);
str = deparse_expression_pretty(node, context, false, false,