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

Commitf6c750d

Browse files
committed
Improve tab completion of ALTER TYPE in psql
This commit adds support for more tab completion in this command as of"ALTER TYPE .. SET". The completion of "RENAME VALUE" was separatedfrom the rest of the completions done for this command, so groupeverything together.Author: Vignesh CDiscussion:https://postgr.es/m/CALDaNm1u83jtD2wysdw9XwokEacSXEyUpELajEvOMgJTc3pQ7g@mail.gmail.com
1 parentf2108d3 commitf6c750d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

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

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2516,6 +2516,17 @@ psql_completion(const char *text, int start, int end)
25162516
/* ALTER TYPE ALTER ATTRIBUTE <foo> */
25172517
elseif (Matches("ALTER","TYPE",MatchAny,"ALTER","ATTRIBUTE",MatchAny))
25182518
COMPLETE_WITH("TYPE");
2519+
/* complete ALTER TYPE <sth> RENAME VALUE with list of enum values */
2520+
elseif (Matches("ALTER","TYPE",MatchAny,"RENAME","VALUE"))
2521+
COMPLETE_WITH_ENUM_VALUE(prev3_wd);
2522+
/* ALTER TYPE <foo> SET */
2523+
elseif (Matches("ALTER","TYPE",MatchAny,"SET"))
2524+
COMPLETE_WITH("(","SCHEMA");
2525+
/* complete ALTER TYPE <foo> SET ( with settable properties */
2526+
elseif (Matches("ALTER","TYPE",MatchAny,"SET","("))
2527+
COMPLETE_WITH("ANALYZE","RECEIVE","SEND","STORAGE","SUBSCRIPT",
2528+
"TYPMOD_IN","TYPMOD_OUT");
2529+
25192530
/* complete ALTER GROUP <foo> */
25202531
elseif (Matches("ALTER","GROUP",MatchAny))
25212532
COMPLETE_WITH("ADD USER","DROP USER","RENAME TO");
@@ -2526,12 +2537,6 @@ psql_completion(const char *text, int start, int end)
25262537
elseif (Matches("ALTER","GROUP",MatchAny,"ADD|DROP","USER"))
25272538
COMPLETE_WITH_QUERY(Query_for_list_of_roles);
25282539

2529-
/*
2530-
* If we have ALTER TYPE <sth> RENAME VALUE, provide list of enum values
2531-
*/
2532-
elseif (Matches("ALTER","TYPE",MatchAny,"RENAME","VALUE"))
2533-
COMPLETE_WITH_ENUM_VALUE(prev3_wd);
2534-
25352540
/*
25362541
* ANALYZE [ ( option [, ...] ) ] [ table_and_columns [, ...] ]
25372542
* ANALYZE [ VERBOSE ] [ table_and_columns [, ...] ]

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp