aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/print.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/nodes/print.c')
-rw-r--r--src/backend/nodes/print.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/backend/nodes/print.c b/src/backend/nodes/print.c
index 1a7e1afb71e..e50ebf2bb55 100644
--- a/src/backend/nodes/print.c
+++ b/src/backend/nodes/print.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.82 2007/01/05 22:19:30 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/nodes/print.c,v 1.83 2007/01/20 20:45:38 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@@ -404,7 +404,7 @@ print_expr(Node *expr, List *rtable)
/*
* print_pathkeys -
- * pathkeys list of list of PathKeyItems
+ * pathkeys list of PathKeys
*/
void
print_pathkeys(List *pathkeys, List *rtable)
@@ -414,17 +414,26 @@ print_pathkeys(List *pathkeys, List *rtable)
printf("(");
foreach(i, pathkeys)
{
- List *pathkey = (List *) lfirst(i);
+ PathKey *pathkey = (PathKey *) lfirst(i);
+ EquivalenceClass *eclass;
ListCell *k;
+ bool first = true;
+
+ eclass = pathkey->pk_eclass;
+ /* chase up, in case pathkey is non-canonical */
+ while (eclass->ec_merged)
+ eclass = eclass->ec_merged;
printf("(");
- foreach(k, pathkey)
+ foreach(k, eclass->ec_members)
{
- PathKeyItem *item = (PathKeyItem *) lfirst(k);
+ EquivalenceMember *mem = (EquivalenceMember *) lfirst(k);
- print_expr(item->key, rtable);
- if (lnext(k))
+ if (first)
+ first = false;
+ else
printf(", ");
+ print_expr((Node *) mem->em_expr, rtable);
}
printf(")");
if (lnext(i))