Re: Support tab completion for upper character inputs in psql
Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
From: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>, Peter Eisentraut
<peter.eisentraut@enterprisedb.com>, Japin Li <japinli@hotmail.com>,
Kyotaro Horiguchi <horikyota.ntt@gmail.com>, Laurenz Albe
<laurenz.albe@cybertec.at>, "smithpb2250@gmail.com"
<smithpb2250@gmail.com>, "david.zhang@highgo.ca" <david.zhang@highgo.ca>,
"pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2022-01-31T01:28:45Z
Lists: pgsql-hackers
Attachments
Tom Lane <tgl@sss.pgh.pa.us> writes: > "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com> writes: >> Thanks for your V16 patch, I tested it. >> The results LGTM. > > Pushed, thanks for looking. I wasn't following this thread, but I noticed a few small potential improvements when I saw the commit. First, as noted in the test, it doesn't preserve the case of the input for keywords appended to the query result. This is easily fixed by using `pg_strdup_keyword_case()`, per the first attached patch. The second might be more of a matter of style or opinion, but I noticed a bunch of `if (foo) free(foo);`, which is redundant given that `free(NULL)` is a no-op. To simplify the code further, I also made `escape_string(NULL)` be a no-op, returning `NULL`. - ilmari
Commits
-
Fix minor memory leaks in psql's tab completion.
- 90474c16a7d2 16.0 landed
- 00cf40328a31 15.0 landed
-
Further tweaks for psql's new tab-completion logic.
- f0cd9097cfac 15.0 landed
-
Treat case of tab-completion keywords a bit more carefully.
- 020258fbd30d 15.0 landed
-
psql: improve tab-complete's handling of variant SQL names.
- 02b8048ba5dc 15.0 landed
-
Make PQcancel use the PGconn's tcp_user_timeout and keepalives settings.
- 5987feb70b5b 15.0 cited
-
Use a WaitLatch for vacuum/autovacuum sleeping
- 4753ef37e0ed 14.0 cited