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

Commit9aa58d4

Browse files
committed
Add a few new patterns to the tab completion of psql
This improves the tab completion of psql on a few points:- Provide a list of subscriptions on \dRs.- Provide a list of publications on \dRp.- Add CURRENT_ROLE, CURRENT_USER, SESSION_USER when OWNER TO is providedat the end of a query (as defined by RoleSpec in gram.y).Author: Vignesh CReviewed-by: Dagfinn Ilmari MannsåkerDiscussion:https://postgr.es/m/CALDaNm3toRBt6c6saY3174f7CsGztXRvVvfWbikkJEXY7x5WAA@mail.gmail.com
1 parentbdf9b60 commit9aa58d4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4160,7 +4160,10 @@ psql_completion(const char *text, int start, int end)
41604160

41614161
/* OWNER TO - complete with available roles */
41624162
elseif (TailMatches("OWNER","TO"))
4163-
COMPLETE_WITH_QUERY(Query_for_list_of_roles);
4163+
COMPLETE_WITH_QUERY_PLUS(Query_for_list_of_roles,
4164+
"CURRENT_ROLE",
4165+
"CURRENT_USER",
4166+
"SESSION_USER");
41644167

41654168
/* ORDER BY */
41664169
elseif (TailMatches("FROM",MatchAny,"ORDER"))
@@ -4614,6 +4617,10 @@ psql_completion(const char *text, int start, int end)
46144617
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_partitioned_tables);
46154618
elseif (TailMatchesCS("\\dP*"))
46164619
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_partitioned_relations);
4620+
elseif (TailMatchesCS("\\dRp*"))
4621+
COMPLETE_WITH_VERSIONED_QUERY(Query_for_list_of_publications);
4622+
elseif (TailMatchesCS("\\dRs*"))
4623+
COMPLETE_WITH_VERSIONED_QUERY(Query_for_list_of_subscriptions);
46174624
elseif (TailMatchesCS("\\ds*"))
46184625
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_sequences);
46194626
elseif (TailMatchesCS("\\dt*"))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp