Re: list of extended statistics on psql (\dX)

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Cc: Tatsuro Yamada <tatsuro(dot)yamada(dot)tf(at)nttcom(dot)co(dot)jp>, "Shinoda, Noriyoshi (PN Japan FSIP)" <noriyoshi(dot)shinoda(at)hpe(dot)com>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: list of extended statistics on psql (\dX)
Date: 2021-05-30 17:24:18
Message-ID: 20210530172418.GO2082@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 20, 2021 at 11:00:50PM +0100, Tomas Vondra wrote:
> Thanks, I've pushed this. I had to tweak the regression tests a bit, for two
> reasons:

\dX isn't checking schema visibility rules, so accidentally shows stats objects
outside of the search path. I noticed after installing the PG14b1 client,
since we create stats objects in a separate schema to allow excluding them with
pg_dump -N.

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index 195f8d8cd2..e29f13c65e 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4774,7 +4774,7 @@ listExtendedStats(const char *pattern)
processSQLNamePattern(pset.db, &buf, pattern,
false, false,
"es.stxnamespace::pg_catalog.regnamespace::text", "es.stxname",
- NULL, NULL);
+ NULL, "pg_catalog.pg_statistics_obj_is_visible(es.oid)");

appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2021-05-30 19:51:54 Re: Fdw batch insert error out when set batch_size > 65535
Previous Message Tom Lane 2021-05-30 17:22:56 Reducing memory consumption for pending inval messages