Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neIJD-0002Eh-Os for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 15:19:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1neIJC-0006wi-JF for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Apr 2022 15:19:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neIJC-0006wT-9o for pgsql-hackers@lists.postgresql.org; Tue, 12 Apr 2022 15:19:58 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1neIJ6-0006M3-05; Tue, 12 Apr 2022 15:19:57 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 23CFJeMO807243; Tue, 12 Apr 2022 11:19:40 -0400 From: Tom Lane To: "Jonathan S. Katz" cc: Julien Rouhaud , Christoph Berg , Pavel Stehule , "David G. Johnston" , Joe Conway , Mark Dilger , Andrew Dunstan , David Rowley , Alvaro Herrera , PostgreSQL Developers Subject: Re: How about a psql backslash command to show GUCs? In-reply-to: <7bba5a32-65fe-04e1-7c36-efd963a625c9@postgresql.org> References: <3370142.1649348973@sss.pgh.pa.us> <2DB6EB50-04DF-49D1-BB5B-61C62898BB35@enterprisedb.com> <3370992.1649349445@sss.pgh.pa.us> <711e43b9-6499-6a8b-0802-fb549874658e@joeconway.com> <3400691.1649363759@sss.pgh.pa.us> <4105551.1649514677@sss.pgh.pa.us> <4115803.1649521632@sss.pgh.pa.us> <043bcb40-052f-5c85-63ff-d6a2b5a0b7ca@postgresql.org> <495595.1649704355@sss.pgh.pa.us> <9439380b-a81f-c910-f527-db4d470b026b@postgresql.org> <531275.1649707882@sss.pgh.pa.us> <7bba5a32-65fe-04e1-7c36-efd963a625c9@postgresql.org> Comments: In-reply-to "Jonathan S. Katz" message dated "Mon, 11 Apr 2022 20:35:52 -0400" MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0" Content-ID: <807019.1649776583.0@sss.pgh.pa.us> Date: Tue, 12 Apr 2022 11:19:40 -0400 Message-ID: <807242.1649776780@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------- =_aaaaaaaaaa0 Content-Type: text/plain; charset="us-ascii" Content-ID: <807019.1649776583.1@sss.pgh.pa.us> "Jonathan S. Katz" 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 ------- =_aaaaaaaaaa0 Content-Type: text/x-diff; name="tweak-dconfig-some-more.patch"; charset="us-ascii" Content-ID: <807019.1649776583.2@sss.pgh.pa.us> Content-Description: tweak-dconfig-some-more.patch Content-Transfer-Encoding: quoted-printable 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;"); = ------- =_aaaaaaaaaa0--