Re: How about a psql backslash command to show GUCs?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: How about a psql backslash command to show GUCs?
Дата
Msg-id 807242.1649776780@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: How about a psql backslash command to show GUCs?  ("Jonathan S. Katz" <jkatz@postgresql.org>)
Ответы Re: How about a psql backslash command to show GUCs?  ("Jonathan S. Katz" <jkatz@postgresql.org>)
Re: How about a psql backslash command to show GUCs?  (Justin Pryzby <pryzby@telsasoft.com>)
Список pgsql-hackers
"Jonathan S. Katz" <jkatz@postgresql.org> writes:
> On 4/11/22 4:11 PM, Tom Lane wrote:
>> This idea does somewhat address my unhappiness upthread about printing
>> values with source = 'internal', but I see that it gets confused by
>> some GUCs with custom show hooks, like unix_socket_permissions.
>> Maybe it needs to be "source != 'default' AND setting != boot_val"?

> Running through a few GUCs, that seems reasonable. Happy to test the 
> patch out prior to commit to see if it renders better.

It'd just look like this, I think.  I see from looking at guc.c that
boot_val can be NULL, so we'd better use IS DISTINCT FROM.

            regards, tom lane

diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
index e7377d4583..17790bd8a4 100644
--- a/src/bin/psql/describe.c
+++ b/src/bin/psql/describe.c
@@ -4410,7 +4410,8 @@ describeConfigurationParameters(const char *pattern, bool verbose,
                               NULL, "pg_catalog.lower(s.name)", NULL,
                               NULL);
     else
-        appendPQExpBufferStr(&buf, "WHERE s.source <> 'default'\n");
+        appendPQExpBufferStr(&buf, "WHERE s.source <> 'default' AND\n"
+                             "      s.setting IS DISTINCT FROM s.boot_val\n");

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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dagfinn Ilmari Mannsåker
Дата:
Сообщение: Re: random() function documentation
Следующее
От: Tom Lane
Дата:
Сообщение: Re: random() function documentation