pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Improve psql's tab completion for ALTER EXTENSION foo UPDATE ... 3+ messages / 1 participants [nested] [flat]
* pgsql: Improve psql's tab completion for ALTER EXTENSION foo UPDATE ... @ 2016-08-18 15:17 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2016-08-18 15:17 UTC (permalink / raw) To: pgsql-committers Improve psql's tab completion for ALTER EXTENSION foo UPDATE ... Offer a list of available versions for that extension. Formerly, since there was no special support for this, it triggered off the UPDATE keyword and offered a list of table names --- not too helpful. Jeff Janes, reviewed by Gerdan Santos Patch: <CAMkU=1z0gxEOLg2BWa69P4X4Ot8xBxipGUiGkXe_tC+raj79-Q@mail.gmail.com> Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/49917dbd76ba0b4179a82fcf033ef5a10b8e3488 Modified Files -------------- src/bin/psql/tab-complete.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Improve psql's tab completion for \l. @ 2016-08-18 15:29 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2016-08-18 15:29 UTC (permalink / raw) To: pgsql-committers Improve psql's tab completion for \l. Offer a list of database names; formerly no help was offered. Ian Barwick, reviewed by Gerdan Santos Patch: <5724132E.1030804@2ndquadrant.com> Branch ------ master Details ------- http://git.postgresql.org/pg/commitdiff/8019b5a89c3cefbaa69ab58c00281419f7e46601 Modified Files -------------- src/bin/psql/tab-complete.c | 2 ++ 1 file changed, 2 insertions(+) -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Improve psql's tab completion for filenames. @ 2020-01-23 16:07 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2020-01-23 16:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Improve psql's tab completion for filenames. The Readline library contains a fair amount of knowledge about how to tab-complete filenames, but it turns out that that doesn't work too well unless we follow its expectation that we use its filename quoting hooks to quote and de-quote filenames. We were trying to do such quote handling within complete_from_files(), and that's still what we have to do if we're using libedit, which lacks those hooks. But for Readline, it works a lot better if we tell Readline that single-quote is a quoting character and then provide hooks that know the details of the quoting rules for SQL and psql meta-commands. Hence, resurrect the quoting hook functions that existed in the original version of tab-complete.c (and were disabled by commit f6689a328 because they "didn't work so well yet"), and whack on them until they do seem to work well. Notably, this fixes bug #16059 from Steven Winfield, who pointed out that the previous coding would strip quote marks from filenames in SQL COPY commands, even though they're syntactically necessary there. Now, we not only don't do that, but we'll add a quote mark when you tab-complete, even if you didn't type one. Getting this to work across a range of libedit versions (and, to a lesser extent, libreadline versions) was depressingly difficult. It will be interesting to see whether the new regression test cases pass everywhere in the buildfarm. Some future patch might try to handle quoted SQL identifiers with similar explicit quoting/dequoting logic, but that's for another day. Patch by me, reviewed by Peter Eisentraut. Discussion: https://postgr.es/m/16059-8836946734c02b84@postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/cd69ec66c88633c09bc9a984a7f0930e09c7c96e Modified Files -------------- config/programs.m4 | 52 ++++++- configure | 87 +++++++++++- configure.in | 2 +- src/bin/psql/stringutils.c | 6 +- src/bin/psql/stringutils.h | 3 +- src/bin/psql/t/010_tab_completion.pl | 74 ++++++++++ src/bin/psql/tab-complete.c | 259 +++++++++++++++++++++++++++++------ src/include/pg_config.h.in | 8 ++ src/tools/msvc/Solution.pm | 2 + 9 files changed, 438 insertions(+), 55 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2020-01-23 16:07 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2016-08-18 15:17 pgsql: Improve psql's tab completion for ALTER EXTENSION foo UPDATE ... Tom Lane <tgl@sss.pgh.pa.us> 2016-08-18 15:29 pgsql: Improve psql's tab completion for \l. Tom Lane <tgl@sss.pgh.pa.us> 2020-01-23 16:07 pgsql: Improve psql's tab completion for filenames. Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox