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

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Joe Conway <mail(at)joeconway(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Pavel Luzanov <p(dot)luzanov(at)postgrespro(dot)ru>, Greg Stark <stark(at)mit(dot)edu>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
Subject: Re: How about a psql backslash command to show GUCs?
Date: 2022-04-07 15:24:49
Message-ID: 20220407152449.GD24419@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Apr 06, 2022 at 11:02:54PM -0400, Tom Lane wrote:
> "Jonathan S. Katz" <jkatz(at)postgresql(dot)org> writes:
> > +1 for \dconf
>
> Here's a draft patch using \dconf. No tests or docs yet.

The patch as written is a thin layer around pg_settings.

SHOW and current_setting() translate to human units, which is particularly
useful for some settings, like those with units of 8k pages.

Is it better to use that "cooked" version for display in the backslash command
instead of the raw view from pg_settings ?

Otherwise, I see myself first using tab completion or, failing that,
SELECT * FROM pg_settings WHERE name~'something', followed by SHOW, to
avoid messing up counting digits, multiplication or unit conversions.

> + printfPQExpBuffer(&buf,
> + "SELECT s.name AS \"%s\", s.setting AS \"%s\", "
> + "s.unit AS \"%s\", s.vartype AS \"%s\"",
> + gettext_noop("Parameter"),
> + gettext_noop("Setting"),
> + gettext_noop("Unit"),
> + gettext_noop("Type"));
> +

> + appendPQExpBufferStr(&buf, "\nFROM pg_catalog.pg_settings s\n");

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Guillaume Lelarge 2022-04-07 15:29:36 Re: REINDEX blocks virtually any queries but some prepared queries.
Previous Message Peter Eisentraut 2022-04-07 15:24:38 Re: unlogged sequences