Don't print extra parens around expressions in extended stats
authorTomas Vondra <tomas.vondra@postgresql.org>
Tue, 31 Aug 2021 22:42:32 +0000 (00:42 +0200)
committerTomas Vondra <tomas.vondra@postgresql.org>
Tue, 31 Aug 2021 22:43:22 +0000 (00:43 +0200)
commit13380e1476490932c7b15530ead1f649a16e1125
tree08283cb56f0fa44de63ba60499ce6bb788a3a1a5
parent47029f775adf83796fecb5871ce52488996a7969
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
src/backend/utils/adt/ruleutils.c
src/bin/pg_dump/t/002_pg_dump.pl
src/test/regress/expected/create_table_like.out
src/test/regress/expected/stats_ext.out