Re: psql: fix variable existence tab completion

From: "Anton A(dot) Melnikov" <a(dot)melnikov(at)postgrespro(dot)ru>
To: Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Erik Wienhold <ewie(at)ewie(dot)name>
Cc: Steve Chavez <steve(at)supabase(dot)io>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: psql: fix variable existence tab completion
Date: 2024-05-06 06:05:38
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


On 14.03.2024 17:57, Alexander Korotkov wrote:
> On Sun, Mar 3, 2024 at 5:37 PM Erik Wienhold <ewie(at)ewie(dot)name> wrote:
>> On 2024-03-03 03:00 +0100, Steve Chavez wrote:
>>> psql has the :{?name} syntax for testing a psql variable existence.
>>> But currently doing \echo :{?VERB<Tab> doesn't trigger tab completion.
>>> This patch fixes it. I've also included a TAP test.
>> Thanks. The code looks good, all tests pass, and the tab completion
>> works as expected when testing manually.

I'm not sure if Debian 10 is actual for the current master. But, if this is the case,
i suggest a patch, since the test will not work under this OS.
The thing is that, Debian 10 will backslash curly braces and the question mark and
TAB completion will lead to the string like that:

\echo :\{\?VERBOSITY\}

instead of expected:

\echo :{?VERBOSITY}

The patch attached fix the test in the same way like [1].

With the best regards,

Anton A. Melnikov
Postgres Professional:
The Russian Postgres Company


Attachment Content-Type Size
0001-Fix-variable-tab-completion-for-broken-libedit.patch text/x-patch 1.1 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Andy Fan 2024-05-06 07:48:10 Re: UniqueKey v2
Previous Message vignesh C 2024-05-06 05:09:54 Re: Documentation to upgrade logical replication cluster