Re: How about a psql backslash command to show GUCs? - Mailing list pgsql-hackers

From Jonathan S. Katz
Subject Re: How about a psql backslash command to show GUCs?
Date
Msg-id 1a853ebb-5a90-bceb-f5c3-767562e00259@postgresql.org
Whole thread Raw
In response to Re: How about a psql backslash command to show GUCs?  (Joe Conway <mail@joeconway.com>)
Responses Re: How about a psql backslash command to show GUCs?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: chap@anastigmatix.net
Date:
Subject: Re: trigger example for plsample
Next
From: Daniel Gustafsson
Date:
Subject: Re: [PATCH] Add native windows on arm64 support