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

Jonathan S. Katz <jkatz@postgresql.org>

From: "Jonathan S. Katz" <jkatz@postgresql.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Julien Rouhaud <rjuju123@gmail.com>, Christoph Berg <myon@debian.org>, Pavel Stehule <pavel.stehule@gmail.com>, "David G. Johnston" <david.g.johnston@gmail.com>, Joe Conway <mail@joeconway.com>, Mark Dilger <mark.dilger@enterprisedb.com>, Andrew Dunstan <andrew@dunslane.net>, David Rowley <dgrowleyml@gmail.com>, Alvaro Herrera <alvherre@alvh.no-ip.org>, PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2022-04-11T19:44:47Z
Lists: pgsql-hackers
On 4/11/22 3:12 PM, Tom Lane wrote:
> "Jonathan S. Katz" <jkatz@postgresql.org> writes:
>> On 4/9/22 12:27 PM, Tom Lane wrote:
>>> Sure, but then you do "\dconfig *".  With there being several hundred
>>> GUCs (and no doubt more coming), I'm not sure that "show me every GUC"
>>> is a common use-case at all, let alone so common as to deserve being
>>> the default behavior.
>>>
>>> One thing we could perhaps do to reduce confusion is to change the
>>> table heading when doing this, say from "List of configuration parameters"
>>> to "List of non-default configuration parameters".
> 
>> Reasonable points. I don't have any objections to this proposal.
> 
> Hearing no further comments, done like that.

Thanks!

I have a usability comment based on my testing.

I ran "\dconfig" and one of the settings that came up was 
"max_connections" which was set to 100, or the default.

I had noticed that "max_connections" was uncommented in my 
postgresql.conf file, which I believe was from the autogenerated 
provided by initdb.

Similarly, min_wal_size/max_wal_size were in the list and set to their 
default values. These were also uncommented in my postgresql.conf from 
the autogeneration.

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?

Thanks,

Jonathan

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Be more careful about GucSource for internally-driven GUC settings.

  2. Fix case sensitivity in psql's tab completion for GUC names.

  3. Further tweak the default behavior of psql's \dconfig.

  4. Tweak the default behavior of psql's \dconfig.

  5. psql: add \dconfig command to show server's configuration parameters.

  6. Allow granting SET and ALTER SYSTEM privileges on GUC parameters.