From: | Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> |
---|---|
To: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | psql: Option to use expanded mode for various meta-commands |
Date: | 2024-12-30 09:10:42 |
Message-ID: | CAEZATCVXJk3KsmCncf7PAVbxdDAUDm3QzDgGT7mBYySWikuOYw@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
The output from various psql meta-commands such as \df+ can be quite
wide, making it hard to read, and there is another patch [1] that will
make it even wider. The output is much more readable if expanded mode
is used, but it's somewhat inconvenient to keep turning that on and
off, if you don't want all other query output in expanded mode.
Attached is a rough patch that adds 'x' as an option to all \d* psql
meta-commands, which forces the output to be displayed in expanded
mode. So, for example, you can type \dfx or \dfx+ (or equivalently
\df+x) to show a list of functions in expanded mode.
This applies to all \d* meta-commands except a bare \d. That
limitation is necessary because \dx already means something else (list
extensions). In the case of \d with a pattern, this limitation isn't
really new, since that already always uses expanded=off for its output
regardless of the current \x setting. However, it does mean that you
can't use 'x' with \d without a pattern to get an expanded mode list
of all relations. However, the limitation only applies as long as
there isn't another character after the \d, so you can type \d+x and
it will work the same as \dtvmsE+x, listing all relations in expanded
mode. So in practice, this doesn't seem like such a bad limitation,
since you're much less likely to need expanded mode with \d without
'+'.
There are a couple of other similar meta-commands (\l and \z) that I
haven't looked at yet, but they should be easy to make work in the
same way, if people think this is useful.
Regards,
Dean
Attachment | Content-Type | Size |
---|---|---|
psql-meta-cmds-expanded-mode.patch | text/x-patch | 26.8 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Jim Jones | 2024-12-30 09:29:33 | Re: [PoC] XMLCast (SQL/XML X025) |
Previous Message | Japin Li | 2024-12-30 09:09:04 | Correct the reference for plpgsql_yyparse() |