pgsql: Don't print extra parens around expressions in extended stats

From: Tomas Vondra <tomas(dot)vondra(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Don't print extra parens around expressions in extended stats
Date: 2021-08-31 23:13:45
Message-ID: E1mLCwr-0006ON-Ox@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/13380e1476490932c7b15530ead1f649a16e1125

Modified Files
--------------
src/backend/utils/adt/ruleutils.c | 2 +-
src/bin/pg_dump/t/002_pg_dump.pl | 2 +-
src/test/regress/expected/create_table_like.out | 6 +-
src/test/regress/expected/stats_ext.out | 110 ++++++++++++------------
4 files changed, 60 insertions(+), 60 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Geoghegan 2021-08-31 23:36:00 pgsql: vacuumlazy.c: Correct prune state comment.
Previous Message Tomas Vondra 2021-08-31 23:13:33 pgsql: Don't print extra parens around expressions in extended stats