diff options
author | Tomas Vondra <tomas.vondra@postgresql.org> | 2021-09-01 00:42:32 +0200 |
---|---|---|
committer | Tomas Vondra <tomas.vondra@postgresql.org> | 2021-09-01 00:43:22 +0200 |
commit | 13380e1476490932c7b15530ead1f649a16e1125 (patch) | |
tree | 08283cb56f0fa44de63ba60499ce6bb788a3a1a5 /src/backend/utils/adt/ruleutils.c | |
parent | 47029f775adf83796fecb5871ce52488996a7969 (diff) | |
download | postgresql-13380e1476490932c7b15530ead1f649a16e1125.tar.gz postgresql-13380e1476490932c7b15530ead1f649a16e1125.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/adt/ruleutils.c')
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index c92958149e8..8ff4e5dc07b 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); |