"Jonathan S. Katz" <jk...@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;");