RE: [PATCH] Add tab-complete for backslash commands

tanghy.fnst@fujitsu.com <tanghy.fnst@fujitsu.com>

From: "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>
To: Tom Lane <tgl@sss.pgh.pa.us>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-09-06T04:31:42Z
Lists: pgsql-hackers
On Sunday, September 5, 2021 1:42 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>I particularly question why we'd offer both
>single- and multiple-character versions, as the single-character
>version seems entirely useless from a completion standpoint.

I generally agreed with your opinion. But I'm not sure if there's someone
who'd like to see the list of backslash commands and choose one to use.
I mean, someone may type '\[tab][tab]' to check all supported backslash commands.
postgres=# \
Display all 105 possibilities? (y or n)
\!             \dc            \dL            \dx            \h             \r
...

In the above scenario, both single- and multiple-character versions could be helpful, thought?

Regards,
Tang

Commits

  1. In psql tab completion, offer spelled-out commands not abbreviations.

  2. Minor improvements for psql help output.