Re: How about a psql backslash command to show GUCs? - Mailing list pgsql-hackers

From Pavel Luzanov
Subject Re: How about a psql backslash command to show GUCs?
Date
Msg-id afcb2e9e-cb7f-6798-0b28-4cf19a43260c@postgrespro.ru
Whole thread Raw
In response to How about a psql backslash command to show GUCs?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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




pgsql-hackers by date:

Previous
From: Matthias van de Meent
Date:
Subject: Re: Preventing indirection for IndexPageGetOpaque for known-size page special areas
Next
From: Pavel Borisov
Date:
Subject: Re: Preventing indirection for IndexPageGetOpaque for known-size page special areas