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 1ne0Oo-0003Gw-15 for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Apr 2022 20:12:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ne0No-00065X-N8 for pgsql-hackers@arkaria.postgresql.org; Mon, 11 Apr 2022 20:11:32 +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 1ne0No-00065N-Df for pgsql-hackers@lists.postgresql.org; Mon, 11 Apr 2022 20:11:32 +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 1ne0Nm-0005Lg-C9; Mon, 11 Apr 2022 20:11:31 +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 23BKBM9x531276; Mon, 11 Apr 2022 16:11:22 -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: <9439380b-a81f-c910-f527-db4d470b026b@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> Comments: In-reply-to "Jonathan S. Katz" message dated "Mon, 11 Apr 2022 15:44:47 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <531274.1649707882.1@sss.pgh.pa.us> Date: Mon, 11 Apr 2022 16:11:22 -0400 Message-ID: <531275.1649707882@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Jonathan S. Katz" writes: > My question is if we're only going to list out the settings that are > customized, are we going to: > 1. Hide a setting if it matches a default value, even if a user set it > to be the default value? OR > 2. Comment out all of the settings in a generated postgresql.conf file? As committed, it prints anything that's shown as "source != 'default'" in pg_settings, which means anything for which the value wasn't taken from the wired-in default. I suppose an alternative definition could be "setting != boot_val". Not really sure if that's better. 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"? regards, tom lane