[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: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-07-15T09:46:18Z
Lists: pgsql-hackers

Attachments

Hi

Attached a patch to improve the tab completion for backslash commands.
I think it’s common for some people(I'm one of them) to use full-name commands than abbreviation.
So it's more convenient if we can add the full-name backslash commands in the tab-complete.c.

When modify tab-complete.c, I found \dS was added in the backslash_commands[], but I think maybe it should be removed just like other \x[S].
So I removed it.
Besides, I also added a little change in help.c.
- exchange the positon of \des and \det according to alphabetical order
- rename PATRN1/PATRN2 to ROLEPTRN/DBPTRN to make expression more comprehensible

Any comment is welcome.

Regards,
Tang

Commits

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

  2. Minor improvements for psql help output.