aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils
diff options
context:
space:
mode:
authorTomas Vondra <tomas.vondra@postgresql.org>2021-09-01 00:42:32 +0200
committerTomas Vondra <tomas.vondra@postgresql.org>2021-09-01 00:44:12 +0200
commit4d1816ec26e877297608a850736afed962527d70 (patch)
tree97f93d390d943f45bc69d953f7496b0e835bd07b /src/backend/utils
parent3eda9fc09fd6b9a1aec2d0113c633c69c3214b4d (diff)
downloadpostgresql-4d1816ec26e877297608a850736afed962527d70.tar.gz
postgresql-4d1816ec26e877297608a850736afed962527d70.zip
Don't print extra parens around expressions in extended stats
The code printing expressions for extended statistics doubled the parens, producing results like ((a+1)), which is unnecessary and not consistent with how we print expressions elsewhere. Fixed by tweaking the code to produce just a single set of parens. Reported by Mark Dilger, fix by me. Backpatch to 14, where support for extended statistics on expressions was added. Reported-by: Mark Dilger Discussion: https://postgr.es/m/20210122040101.GF27167%40telsasoft.com
Diffstat (limited to 'src/backend/utils')
-rw-r--r--src/backend/utils/adt/ruleutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 74fa51c1c64..00f21b10dda 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -1712,7 +1712,7 @@ pg_get_statisticsobj_worker(Oid statextid, bool columns_only, bool missing_ok)
{
Node *expr = (Node *) lfirst(lc);
char *str;
- int prettyFlags = PRETTYFLAG_INDENT;
+ int prettyFlags = PRETTYFLAG_PAREN;
str = deparse_expression_pretty(expr, context, false, false,
prettyFlags, 0);