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

From: ilmari(at)ilmari(dot)org (Dagfinn Ilmari Mannsåker )
To: "tanghy(dot)fnst\(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [PATCH] Add tab-complete for backslash commands
Date: 2021-08-07 23:13:14
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Hi Tang,

"tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com> writes:

> 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.

Even though I usually use the short versions, I agree that having the
full names in tab the completion as well is a good idea.

> 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

These are also good changes.

> Any comment is welcome.
> Regards,
> Tang

> + "\\r", "\\rset",

There's a typo here, that should be "\\reset". Also, I noticed that for
\connect, the situation is the opposite: it has the full form but not
the short form (\c).

I've addressed both in the attached v2 patch.

- ilmari

Attachment Content-Type Size
v2-0001-Add-tab-completion-for-more-backslash-commands.patch text/x-diff 3.9 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Dagfinn Ilmari Mannsåker 2021-08-07 23:15:47 Re: perlcritic: prohibit map and grep in void conext
Previous Message Peter Geoghegan 2021-08-07 22:31:49 Re: ECPG bug fix: DECALRE STATEMENT and DEALLOCATE, DESCRIBE