Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit162ae5b

Browse files
committed
Add tab-completion for psql meta-commands.
Based on the original code from David Christensen, modified by me.
1 parente5460aa commit162ae5b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -897,14 +897,16 @@ psql_completion(const char *text, int start, int end)
897897

898898
staticconstchar*constbackslash_commands[]= {
899899
"\\a","\\connect","\\conninfo","\\C","\\cd","\\copy","\\copyright",
900-
"\\d","\\da","\\db","\\dc","\\dC","\\dd","\\dD","\\des","\\det","\\deu","\\dew","\\df",
900+
"\\d","\\da","\\db","\\dc","\\dC","\\dd","\\ddp","\\dD",
901+
"\\des","\\det","\\deu","\\dew","\\dE","\\df",
901902
"\\dF","\\dFd","\\dFp","\\dFt","\\dg","\\di","\\dl","\\dL",
902-
"\\dn","\\do","\\dp","\\drds","\\ds","\\dS","\\dt","\\dT","\\dv","\\du","\\dx",
903+
"\\dm","\\dn","\\do","\\dO","\\dp","\\drds","\\ds","\\dS",
904+
"\\dt","\\dT","\\dv","\\du","\\dx","\\dy",
903905
"\\e","\\echo","\\ef","\\encoding",
904906
"\\f","\\g","\\gset","\\h","\\help","\\H","\\i","\\ir","\\l",
905907
"\\lo_import","\\lo_export","\\lo_list","\\lo_unlink",
906908
"\\o","\\p","\\password","\\prompt","\\pset","\\q","\\qecho","\\r",
907-
"\\set","\\sf","\\t","\\T",
909+
"\\s","\\set","\\setenv","\\sf","\\t","\\T",
908910
"\\timing","\\unset","\\x","\\w","\\watch","\\z","\\!",NULL
909911
};
910912

@@ -3791,6 +3793,10 @@ psql_completion(const char *text, int start, int end)
37913793
COMPLETE_WITH_QUERY(Query_for_list_of_extensions);
37923794
elseif (strncmp(prev_wd,"\\dm",strlen("\\dm"))==0)
37933795
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_matviews,NULL);
3796+
elseif (strncmp(prev_wd,"\\dE",strlen("\\dE"))==0)
3797+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_foreign_tables,NULL);
3798+
elseif (strncmp(prev_wd,"\\dy",strlen("\\dy"))==0)
3799+
COMPLETE_WITH_QUERY(Query_for_list_of_event_triggers);
37943800

37953801
/* must be at end of \d list */
37963802
elseif (strncmp(prev_wd,"\\d",strlen("\\d"))==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp