Re: How about a psql backslash command to show GUCs?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>, Julien Rouhaud <rjuju123(at)gmail(dot)com>, Christoph Berg <myon(at)debian(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, David Rowley <dgrowleyml(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: How about a psql backslash command to show GUCs?
Date: 2022-06-06 16:02:15
Message-ID: 918042.1654531335@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Justin Pryzby <pryzby(at)telsasoft(dot)com> writes:
> I noticed this is showing "pre-computed" gucs, like:
> shared_memory_size | 149MB
> shared_memory_size_in_huge_pages | 75
> I'm not opposed to that, but I wonder if that's what's intended / best.

I had suggested upthread that we might want to hide items with
source = 'override', but that idea didn't seem to be getting traction.
A different idea is to hide items with context = 'internal'.
Looking at the items selected by the current rule in a default
installation:

postgres=# SELECT s.name, source, context FROM pg_catalog.pg_settings s
WHERE s.source <> 'default' AND
s.setting IS DISTINCT FROM s.boot_val
ORDER BY 1;
name | source | context
----------------------------------+----------------------+------------
TimeZone | configuration file | user
application_name | client | user
client_encoding | client | user
config_file | override | postmaster
data_directory | override | postmaster
default_text_search_config | configuration file | user
hba_file | override | postmaster
ident_file | override | postmaster
lc_messages | configuration file | superuser
log_timezone | configuration file | sighup
max_stack_depth | environment variable | superuser
shared_memory_size | override | internal
shared_memory_size_in_huge_pages | override | internal
wal_buffers | override | postmaster
(14 rows)

So hiding internal-context items would hit exactly the two you mention,
but hiding override-source items would hit several more.

(I'm kind of wondering why wal_buffers is showing as "override";
that seems like a quirk.)

Thoughts?

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2022-06-06 16:46:41 Re: pg_buffercache: add sql test
Previous Message Tomas Vondra 2022-06-06 15:52:46 Re: pgcon unconference / impact of block size on performance