diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 92e5c503003..592356019b5 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -129,7 +129,7 @@ echo '\x \\ SELECT * FROM foo;' | psql for more details about how the server handles multi-query strings.) - If having several commands executed in one transaction is not desired, + If having several commands executed in one transaction is not desired, use repeated commands or feed multiple commands to psql's standard input, either using echo as illustrated above, or @@ -1385,9 +1385,11 @@ testdb=> Lists server configuration parameters and their values. - If pattern - is specified, only parameters whose names match the pattern are - listed. + If pattern is specified, + only parameters whose names match the pattern are listed. Without + a pattern, only + parameters that are set to non-default values are listed. + (Use \dconfig * to see all parameters.) If + is appended to the command name, each parameter is listed with its data type, context in which the parameter can be set, and access privileges (if non-default access 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);