pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Pavel Luzanov <p.luzanov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-hackers@lists.postgresql.org
Cc: Mark Dilger <mark.dilger@enterprisedb.com>
Subject: Re: How about a psql backslash command to show GUCs?
Date: Thu, 7 Apr 2022 11:34:00 +0300
Message-ID: <afcb2e9e-cb7f-6798-0b28-4cf19a43260c@postgrespro.ru> (raw)
In-Reply-To: <3118455.1649267333@sss.pgh.pa.us>
References: <3118455.1649267333@sss.pgh.pa.us>

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






view thread (71+ messages)  latest in thread

Message-ID: <afcb2e9e-cb7f-6798-0b28-4cf19a43260c@postgrespro.ru>
Permalink:  ../afcb2e9e-cb7f-6798-0b28-4cf19a43260c@postgrespro.ru/
Also on:    postgresql.org/message-id/afcb2e9e-cb7f-6798-0b28-4cf19a43260c@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: p.luzanov@postgrespro.ru, tgl@sss.pgh.pa.us, mark.dilger@enterprisedb.com
  Subject: Re: How about a psql backslash command to show GUCs?
  In-Reply-To: <afcb2e9e-cb7f-6798-0b28-4cf19a43260c@postgrespro.ru>
  References: <3118455.1649267333@sss.pgh.pa.us> <afcb2e9e-cb7f-6798-0b28-4cf19a43260c@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox