Re: psql: fix variable existence tab completion - Mailing list pgsql-hackers

From Anton A. Melnikov
Subject Re: psql: fix variable existence tab completion
Date
Msg-id 26eb4e50-3294-4d06-a1fc-2c568bd67f90@postgrespro.ru
Whole thread Raw
In response to Re: psql: fix variable existence tab completion  (Alexander Korotkov <aekorotkov@gmail.com>)
Responses Re: psql: fix variable existence tab completion
List pgsql-hackers
Hello!

On 14.03.2024 17:57, Alexander Korotkov wrote:
> On Sun, Mar 3, 2024 at 5:37 PM Erik Wienhold <ewie@ewie.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 010_tab_completion.pl test in the same way like [1].

With the best regards,

-- 
Anton A. Melnikov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

[1] https://www.postgresql.org/message-id/960764.1643751011@sss.pgh.pa.us
Attachment

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Documentation to upgrade logical replication cluster
Next
From: Andy Fan
Date:
Subject: Re: UniqueKey v2