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 1ncNai-0006Kt-NV for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Apr 2022 08:34:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ncNah-0007hP-Aq for pgsql-hackers@arkaria.postgresql.org; Thu, 07 Apr 2022 08:34:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ncNag-0007hG-Sc for pgsql-hackers@lists.postgresql.org; Thu, 07 Apr 2022 08:34:07 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ncNad-0007a5-U6 for pgsql-hackers@lists.postgresql.org; Thu, 07 Apr 2022 08:34:06 +0000 Received: from [192.168.28.30] (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id F40E321C043B; Thu, 7 Apr 2022 11:34:01 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1649320442; bh=AQH7uSV0aTAhdlnhDTsLrIUjuDe6I1MuW6A5xvVzels=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=J5pGXRrJ3d7sh2jZbQ4bIxbNbAnUPSicyNL+jzD9Ug5Y8PktXgYRmjqTIICsLz6HK oORRZ7k8jr0fnqy5gWOwWizhKF0NFmOvwnvabQYeE0rpIcyg0O7RorhciZzc2hjg0/ U6ayNVypzGd8vkeKcawABDEr7Q7g+FIAxJ9yOa3k= Message-ID: Date: Thu, 7 Apr 2022 11:34:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: How about a psql backslash command to show GUCs? Content-Language: en-US To: Tom Lane , pgsql-hackers@lists.postgresql.org Cc: Mark Dilger References: <3118455.1649267333@sss.pgh.pa.us> From: Pavel Luzanov In-Reply-To: <3118455.1649267333@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 06.04.2022 20:48, Tom Lane wrote: > However, I very often > find myself resorting to the much more tedious > > select * from pg_settings where name like '%foo%'; > In the discussion about adding privileges for GUCs [1], there > was a proposal to add a new psql backslash command to show GUCs, > which could reduce this problem to something like > > \dcp *foo* +1, great idea. Right now I use the psql :show variable in my .psqlrc for this purpose: =# \echo :show SELECT name, current_setting(name) AS value, context FROM pg_settings\g (format=wrapped columns=100) | grep =# :show autovacuum  autovacuum                             | on                                    | sighup  autovacuum_analyze_scale_factor        | 0.1                                   | sighup  autovacuum_analyze_threshold           | 50                                    | sighup  autovacuum_freeze_max_age              | 200000000                             | postmaster  autovacuum_max_workers                 | 3                                     | postmaster  autovacuum_multixact_freeze_max_age    | 400000000                             | postmaster  autovacuum_naptime                     | 1min                                  | sighup  autovacuum_vacuum_cost_delay           | 2ms                                   | sighup  autovacuum_vacuum_cost_limit           | -1                                    | sighup  autovacuum_vacuum_scale_factor         | 0.2                                   | sighup  autovacuum_vacuum_threshold            | 50                                    | sighup  autovacuum_work_mem                    | -1                                    | sighup  log_autovacuum_min_duration            | -1                                    | sighup As for the name, I can't think of a better candidate. Any of the previously suggested list of \dconf, \dguc, \dG, \dcp is fine. -- Pavel Luzanov Postgres Professional: https://postgrespro.com The Russian Postgres Company