Skip to content

Commit f50f348

Browse files
author
Commitfest Bot
committed
[CF 5963] v2 - Tab completion for large objects
This branch was automatically generated by a robot using patches from an email thread registered at: https://commitfest.postgresql.org/patch/5963 The branch will be overwritten each time a new patch version is posted to the thread, and also periodically to check for bitrot caused by changes on the master branch. Patch(es): https://www.postgresql.org/message-id/CAHGQGwHfzMsFJt3-q5ixGsa0Mu9peqLMv+7_OmnLGLRpkuYggQ@mail.gmail.com Author(s): Dagfinn Ilmari Mannsåker
2 parents 88824e6 + b5c2ad5 commit f50f348

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/bin/psql/tab-complete.in.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4550,13 +4550,10 @@ match_previous_words(int pattern_id,
45504550
"ROUTINES IN SCHEMA",
45514551
"SEQUENCES IN SCHEMA",
45524552
"TABLES IN SCHEMA");
4553-
else if (TailMatches("GRANT|REVOKE", MatchAny, "ON", "FOREIGN") ||
4554-
TailMatches("REVOKE", "GRANT", "OPTION", "FOR", MatchAny, "ON", "FOREIGN"))
4555-
COMPLETE_WITH("DATA WRAPPER", "SERVER");
45564553

45574554
/*
45584555
* Complete "GRANT/REVOKE * ON DATABASE/DOMAIN/..." with a list of
4559-
* appropriate objects.
4556+
* appropriate objects or keywords.
45604557
*
45614558
* Complete "GRANT/REVOKE * ON *" with "TO/FROM".
45624559
*/
@@ -4569,8 +4566,17 @@ match_previous_words(int pattern_id,
45694566
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_domains);
45704567
else if (TailMatches("FUNCTION"))
45714568
COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_functions);
4569+
else if (TailMatches("FOREIGN"))
4570+
COMPLETE_WITH("DATA WRAPPER", "SERVER");
45724571
else if (TailMatches("LANGUAGE"))
45734572
COMPLETE_WITH_QUERY(Query_for_list_of_languages);
4573+
else if (TailMatches("LARGE"))
4574+
{
4575+
if (HeadMatches("ALTER", "DEFAULT", "PRIVILEGES"))
4576+
COMPLETE_WITH("OBJECTS");
4577+
else
4578+
COMPLETE_WITH("OBJECT");
4579+
}
45744580
else if (TailMatches("PROCEDURE"))
45754581
COMPLETE_WITH_VERSIONED_SCHEMA_QUERY(Query_for_list_of_procedures);
45764582
else if (TailMatches("ROUTINE"))
@@ -5528,7 +5534,8 @@ match_previous_words(int pattern_id,
55285534
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_views);
55295535
else if (TailMatchesCS("\\cd|\\e|\\edit|\\g|\\gx|\\i|\\include|"
55305536
"\\ir|\\include_relative|\\o|\\out|"
5531-
"\\s|\\w|\\write|\\lo_import"))
5537+
"\\s|\\w|\\write|\\lo_import") ||
5538+
TailMatchesCS("\\lo_export", MatchAny))
55325539
{
55335540
completion_charp = "\\";
55345541
completion_force_quote = false;

0 commit comments

Comments
 (0)