Re: psql: fix variable existence tab completion

Anton A. Melnikov <a.melnikov@postgrespro.ru>

From: "Anton A. Melnikov" <a.melnikov@postgrespro.ru>
To: Alexander Korotkov <aekorotkov@gmail.com>
Cc: Erik Wienhold <ewie@ewie.name>, Steve Chavez <steve@supabase.io>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2024-05-07T07:37:27Z
Lists: pgsql-hackers
Hi, Alexander!

On 06.05.2024 13:19, Alexander Korotkov wrote:
>> The patch attached fix the 010_tab_completion.pl test in the same way like [1].
> 
> Thank you for the fix.  As I get, the fix teaches
> 010_tab_completion.pl to tolerate the invalid result of tab
> completion.  Do you think we could fix it another way to make the
> result of tab completion correct?

Right now i don't see any straight way to fix this to the correct tab completion.
There are several similar cases in this test.
E.g., for such a commands:
  
  CREATE TABLE "mixedName" (f1 int, f2 text);
  select * from "mi<TAB> ;

gives with debian 10:
postgres=# select * from \"mixedName\" ;

resulting in an error.
  
Now there is a similar workaround in the 010_tab_completion.pl with regex: qr/"mixedName\\?" /

I think if there were or will be complaints from users about this behavior in Debian 10,
then it makes sense to look for more complex solutions that will fix a backslash substitutions.
If no such complaints, then it is better to make a workaround in test.

With the best wishes,

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



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Remove test-case workarounds for ancient libedit versions.

  2. psql: fix variable existence tab completion