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

From: "Jonathan S(dot) Katz" <jkatz(at)postgresql(dot)org>
To: Joe Conway <mail(at)joeconway(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
Subject: Re: How about a psql backslash command to show GUCs?
Date: 2022-04-07 14:39:47
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: 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(at)postgresql(dot)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 "". 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;

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

+ fprintf(output, _(" \\dconf[+] [PATTERN] list configuration

Maybe to appeal to all crowds, we say "list configuration parameters



In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2022-04-07 14:55:27 Re: [PATCH] Add native windows on arm64 support
Previous Message chap 2022-04-07 14:30:13 Re: trigger example for plsample