pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jonathan S. Katz <jkatz@postgresql.org>
To: Joe Conway <mail@joeconway.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: David G. Johnston <david.g.johnston@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Cc: Mark Dilger <mark.dilger@enterprisedb.com>
Subject: Re: How about a psql backslash command to show GUCs?
Date: Thu, 7 Apr 2022 10:39:47 -0400
Message-ID: <1a853ebb-5a90-bceb-f5c3-767562e00259@postgresql.org> (raw)
In-Reply-To: <5588a650-48e2-3d3d-ad36-a1ea6787a15a@joeconway.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>
	<5588a650-48e2-3d3d-ad36-a1ea6787a15a@joeconway.com>

On 4/7/22 8:36 AM, Joe Conway wrote:
> On 4/6/22 23:02, 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.
> 
> WFM -- using some form of \d<something> makes more sense than 
> \s<something>, and I can't think of anything better that \dconf.
> 
> I will say that I care about context far more often than unit or type 
> though, so from my point of view I would switch them around with respect 
> to which is only shown with verbose.

I disagree somewhat -- I agree the context should be in the regular 
view, but unit and type are also important. If I had to choose to drop 
one, I'd choose type as it could be inferred, but I would say better to 
keep them all.

The downside is that by including context, the standard list appears to 
push past my 99px width terminal in non-enhanced view, but that may be OK.


A couple of minor things:

	+	appendPQExpBufferStr(&buf, "ORDER BY 1;");

I don't know how much we do positional ordering in our queries, but it 
may be better to explicitly order by "s.name". I doubt this column name 
is likely to change, and if for some reason someone shuffles the output 
order of \dconf, it makes it less likely to break someone's view.

I did not test this via an extension, but we do allow for mixed case in 
custom GUCs:

postgres=# SHOW jkatz.test;
  JKATZ.test
------------
  abc

I don't know if we want to throw a "LOWER(s.name)" on at least the 
ordering, given we allow for "SHOW" itself to load these case-insensitively.

	+	fprintf(output, _("  \\dconf[+] [PATTERN]    list configuration 
parameters\n"));

Maybe to appeal to all crowds, we say "list configuration parameters 
(GUCs)"?

Thanks,

Jonathan


Attachments:

  OpenPGP_signature (application/pgp-signature, 839B) download

view thread (71+ messages)  latest in thread

Message-ID: <1a853ebb-5a90-bceb-f5c3-767562e00259@postgresql.org>
Permalink:  ../1a853ebb-5a90-bceb-f5c3-767562e00259@postgresql.org/
Also on:    postgresql.org/message-id/1a853ebb-5a90-bceb-f5c3-767562e00259@postgresql.org

 · 

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: jkatz@postgresql.org, mail@joeconway.com, tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, alvherre@alvh.no-ip.org, mark.dilger@enterprisedb.com
  Subject: Re: How about a psql backslash command to show GUCs?
  In-Reply-To: <1a853ebb-5a90-bceb-f5c3-767562e00259@postgresql.org>
  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> <5588a650-48e2-3d3d-ad36-a1ea6787a15a@joeconway.com> <1a853ebb-5a90-bceb-f5c3-767562e00259@postgresql.org>

* 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