mirror of
https://github.com/postgres/postgres.git
synced 2025-10-22 14:32:25 +03:00
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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user