Re: psql: Option to use expanded mode for various meta-commands

Dean Rasheed <dean.a.rasheed@gmail.com>

From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Greg Sabino Mullane <htamfids@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-01-08T13:43:57Z
Lists: pgsql-hackers

Attachments

On Mon, 30 Dec 2024 at 15:48, Greg Sabino Mullane <htamfids@gmail.com> wrote:
>
> I like this, very useful. It's a shame about the conflict with \dx (lesson for the future: think extra carefully about option namings!). I am impressed that \dx   \d   \d+   \d+x  and even \dxx all work as one might intuit with this patch.
>

Thanks for looking.

Attached is a more complete patch, now with
 - trivial bug-fix for previous \d code, per cfbot
 - expanded mode support for \l and \z
 - updated psql help
 - a few representative regression test cases

The majority of the patch is doc updates, which are somewhat tedious.
Initially, I resisted documenting the 'x' option in the description of
every command affected, but given the length of the list of commands
in the HTML page, it's a long way from any given command to the top or
bottom where 'x' is described in more detail. So in the end, I decided
to just add a sentence to each command's description, keeping it as
short as possible.

Regards,
Dean

Commits

  1. psql: Add option to use expanded mode to all list commands.