RE: Support tab completion for upper character inputs in psql

tanghy.fnst@fujitsu.com <tanghy.fnst@fujitsu.com>

From: "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>
To: David Zhang <david.zhang@highgo.ca>, Peter Eisentraut <peter.eisentraut@enterprisedb.com>, Kyotaro Horiguchi <horikyota.ntt@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>
Cc: "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2021-04-01T09:40:50Z
Lists: pgsql-hackers

Attachments

On Wednesday, March 31, 2021 4:05 AM, David Zhang <david.zhang@highgo.ca> wrote

>   8 postgres=# update tbl SET DATA =
>   9
>  10 postgres=# update TBL SET
>  11
>  12 postgres=#
>
>So, as you can see the difference is between line 8 and 10 in case 2. It 
>looks like the lowercase can auto complete more than the uppercase; 
>secondly, if you can add some test cases, it would be great.

Thanks for your test. I fix the bug and add some tests for it.
Please find attached the latest patch V4.

Differences from v3 are:
* fix an issue reported by Zhang [1] where a scenario was found which still wasn't able to realize tap completion in query.
* add some tap tests.

[1] https://www.postgresql.org/message-id/3140db2a-9808-c470-7e60-de39c431b3ab%40highgo.ca

Regards,
Tang

Commits

  1. Fix minor memory leaks in psql's tab completion.

  2. Further tweaks for psql's new tab-completion logic.

  3. Treat case of tab-completion keywords a bit more carefully.

  4. psql: improve tab-complete's handling of variant SQL names.

  5. Make PQcancel use the PGconn's tcp_user_timeout and keepalives settings.

  6. Use a WaitLatch for vacuum/autovacuum sleeping