From 9a2587b89cd7f1ea11667b96bc3b8057d67fa548 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 13 Dec 2004 00:33:18 +0000 Subject: [PATCH] Avoid generating excess (and illegal) parentheses around an aliased JOIN in prettyprint mode. Andreas Pflug --- src/backend/utils/adt/ruleutils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index aceb02699c..08b25a8447 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -3903,7 +3903,8 @@ get_from_clause_item(Node *jtnode, Query *query, deparse_context *context) bool need_paren_on_right; need_paren_on_right = PRETTY_PAREN(context) && - !IsA(j->rarg, RangeTblRef); + !IsA(j->rarg, RangeTblRef) && + !(IsA(j->rarg, JoinExpr) && ((JoinExpr*) j->rarg)->alias != NULL); if (!PRETTY_PAREN(context) || j->alias != NULL) appendStringInfoChar(buf, '('); -- 2.39.5