Don't print extra parens around expressions in extended stats

Tomas Vondra <tomas.vondra@postgresql.org>

Commit: 4d1816ec26e877297608a850736afed962527d70
Author: Tomas Vondra <tomas.vondra@postgresql.org>
Date: 2021-08-31T22:44:12Z
Releases: 14.0
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

Files

Discussion