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

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: "Jonathan S. Katz" <jkatz@postgresql.org>
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-12T17:00:41Z
Lists: pgsql-hackers
"Jonathan S. Katz" <jkatz@postgresql.org> writes:
> On 4/12/22 11:19 AM, Tom Lane wrote:
>> It'd just look like this, I think.  I see from looking at guc.c that
>> boot_val can be NULL, so we'd better use IS DISTINCT FROM.

> I tested it and I like this a lot better, at least it's much more 
> consolidated. They all seem to be generated (directories, timezones, 
> collations/encodings).

Yeah, most of what shows up in a minimally-configured installation is
postmaster-computed settings like config_file, rather than things
that were actually set by the DBA.  Personally I'd rather hide the
ones that have source = 'override', but that didn't seem to be the
consensus.

> The one exception to this seems to be "max_stack_depth", which is 
> rendering on my "\dconfig" though I didn't change it, an it's showing 
> it's default value of 2MB. "boot_val" says 100, "reset_val" says 2048, 
> and it's commented out in my postgresql.conf. Do we want to align that?

I don't think there's any principled thing we could do about that in
psql.  The boot_val is a conservatively small 100kB, but we crank
that up automatically based on getrlimit(RLIMIT_STACK), so on any
reasonable platform it's going to show as not being default.

			regards, tom lane



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.