Re: list of extended statistics on psql (\dX) - Mailing list pgsql-hackers

From Tomas Vondra
Subject Re: list of extended statistics on psql (\dX)
Date
Msg-id 519d629f-8932-6850-0bbf-50f36b8c7b86@enterprisedb.com
Whole thread Raw
In response to RE: list of extended statistics on psql  ("Shinoda, Noriyoshi (PN Japan FSIP)" <noriyoshi.shinoda@hpe.com>)
Responses Re: list of extended statistics on psql (\dX)
List pgsql-hackers

On 5/30/21 7:24 PM, Justin Pryzby wrote:
> 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;");
>  

Thanks for noticing this! Will push.


regards

-- 
Tomas Vondra
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Fdw batch insert error out when set batch_size > 65535
Next
From: Andres Freund
Date:
Subject: Re: O_DIRECT on macOS