pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Jonathan S. Katz <jkatz@postgresql.org>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Joe Conway <mail@joeconway.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-hackers@lists.postgresql.org, Pavel Luzanov <p.luzanov@postgrespro.ru>
Cc: Greg Stark <stark@mit.edu>
Cc: Mark Dilger <mark.dilger@enterprisedb.com>
Subject: Re: How about a psql backslash command to show GUCs?
Date: Thu, 7 Apr 2022 10:24:49 -0500
Message-ID: <20220407152449.GD24419@telsasoft.com> (raw)
In-Reply-To: <3221981.1649300574@sss.pgh.pa.us>
References: <202204061758.leffczewl4kd@alvherre.pgsql>
	<ae4c3347-d1c7-394f-9a7e-425af6f89a80@joeconway.com>
	<3123259.1649270440@sss.pgh.pa.us>
	<38891fd8-dceb-c956-ec5c-61c1a3e9486d@postgresql.org>
	<3201870.1649294165@sss.pgh.pa.us>
	<CAKFQuwaqBF_QoQC8aoqBiY4ggvBU6fR0k6CjeTQcoLy_9V4Sng@mail.gmail.com>
	<6693b128-b9e5-fd5e-e8d2-b331dac52cb8@postgresql.org>
	<3221981.1649300574@sss.pgh.pa.us>

On Wed, Apr 06, 2022 at 11:02:54PM -0400, Tom Lane wrote:
> "Jonathan S. Katz" <jkatz@postgresql.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");





view thread (71+ messages)  latest in thread

Message-ID: <20220407152449.GD24419@telsasoft.com>
Permalink:  ../20220407152449.GD24419@telsasoft.com/
Also on:    postgresql.org/message-id/20220407152449.GD24419@telsasoft.com

 · 

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: pryzby@telsasoft.com, tgl@sss.pgh.pa.us, jkatz@postgresql.org, david.g.johnston@gmail.com, mail@joeconway.com, alvherre@alvh.no-ip.org, p.luzanov@postgrespro.ru, stark@mit.edu, mark.dilger@enterprisedb.com
  Subject: Re: How about a psql backslash command to show GUCs?
  In-Reply-To: <20220407152449.GD24419@telsasoft.com>
  References: <202204061758.leffczewl4kd@alvherre.pgsql> <ae4c3347-d1c7-394f-9a7e-425af6f89a80@joeconway.com> <3123259.1649270440@sss.pgh.pa.us> <38891fd8-dceb-c956-ec5c-61c1a3e9486d@postgresql.org> <3201870.1649294165@sss.pgh.pa.us> <CAKFQuwaqBF_QoQC8aoqBiY4ggvBU6fR0k6CjeTQcoLy_9V4Sng@mail.gmail.com> <6693b128-b9e5-fd5e-e8d2-b331dac52cb8@postgresql.org> <3221981.1649300574@sss.pgh.pa.us> <20220407152449.GD24419@telsasoft.com>

* 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