diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-04-11 15:11:46 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-04-11 15:11:46 -0400 |
commit | 5e70d8b5d18b0a71528dc6f11ade31a9d10e00cb (patch) | |
tree | 04efa0db49e5d4030d0983a4e6eda8dc8d160457 /src | |
parent | 3c702b3ed1519624d50e7a42283b8d481a579f77 (diff) | |
download | postgresql-5e70d8b5d18b0a71528dc6f11ade31a9d10e00cb.tar.gz postgresql-5e70d8b5d18b0a71528dc6f11ade31a9d10e00cb.zip |
Tweak the default behavior of psql's \dconfig.
\dconfig without an argument originally printed all parameters,
but it seems more useful to print only those parameters with
non-default settings. You can easily get the show-everything
behavior with "\dconfig *", but that output is unwieldy and
seems unlikely to be wanted very often.
Per suggestion from Christoph Berg.
Discussion: https://postgr.es/m/YlFQLzlPi4QD0wSi@msg.df7cb.de
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/describe.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index d04ba2b0290..e7377d4583f 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -4404,10 +4404,13 @@ describeConfigurationParameters(const char *pattern, bool verbose, " LEFT JOIN pg_catalog.pg_parameter_acl p\n" " ON pg_catalog.lower(s.name) = p.parname\n"); - processSQLNamePattern(pset.db, &buf, pattern, - false, false, - NULL, "pg_catalog.lower(s.name)", NULL, - NULL); + if (pattern) + processSQLNamePattern(pset.db, &buf, pattern, + false, false, + NULL, "pg_catalog.lower(s.name)", NULL, + NULL); + else + appendPQExpBufferStr(&buf, "WHERE s.source <> 'default'\n"); appendPQExpBufferStr(&buf, "ORDER BY 1;"); @@ -4417,7 +4420,10 @@ describeConfigurationParameters(const char *pattern, bool verbose, return false; myopt.nullPrint = NULL; - myopt.title = _("List of configuration parameters"); + if (pattern) + myopt.title = _("List of configuration parameters"); + else + myopt.title = _("List of non-default configuration parameters"); myopt.translate_header = true; printQuery(res, &myopt, pset.queryFout, false, pset.logfile); |