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

Commit89611c4

Browse files
committed
Various fixes to "ALTER ... SET/RESET" tab completions
Add- ALTER SYSTEM SET/RESET ... -> GUC variables- ALTER TABLE ... SET WITH -> OIDS- ALTER DATABASE/FUNCTION/ROLE/USER ... SET/RESET -> GUC variables- ALTER DATABASE/FUNCTION/ROLE/USER ... SET ... -> FROM CURRENT/TO- ALTER DATABASE/FUNCTION/ROLE/USER ... SET ... TO/= -> possible valuesAuthor: Fujii MasaoReviewed-by: Michael Paquier, Masahiko Sawada
1 parent7a58d19 commit89611c4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1553,7 +1553,7 @@ psql_completion(const char *text, int start, int end)
15531553
elseif (Matches2("ALTER","SYSTEM"))
15541554
COMPLETE_WITH_LIST2("SET","RESET");
15551555
/* ALTER SYSTEM SET|RESET <name> */
1556-
elseif (Matches4("ALTER","SYSTEM","SET|RESET",MatchAny))
1556+
elseif (Matches3("ALTER","SYSTEM","SET|RESET"))
15571557
COMPLETE_WITH_QUERY(Query_for_list_of_alter_system_set_vars);
15581558
/* ALTER VIEW <name> */
15591559
elseif (Matches3("ALTER","VIEW",MatchAny))
@@ -1754,6 +1754,9 @@ psql_completion(const char *text, int start, int end)
17541754
*/
17551755
elseif (Matches5("ALTER","TABLE",MatchAny,"SET","TABLESPACE"))
17561756
COMPLETE_WITH_QUERY(Query_for_list_of_tablespaces);
1757+
/* If we have ALTER TABLE <sth> SET WITH provide OIDS */
1758+
elseif (Matches5("ALTER","TABLE",MatchAny,"SET","WITH"))
1759+
COMPLETE_WITH_CONST("OIDS");
17571760
/* If we have ALTER TABLE <sth> SET WITHOUT provide CLUSTER or OIDS */
17581761
elseif (Matches5("ALTER","TABLE",MatchAny,"SET","WITHOUT"))
17591762
COMPLETE_WITH_LIST2("CLUSTER","OIDS");
@@ -2702,7 +2705,7 @@ psql_completion(const char *text, int start, int end)
27022705

27032706
/* SET, RESET, SHOW */
27042707
/* Complete with a variable name */
2705-
elseif (Matches1("SET|RESET"))
2708+
elseif (TailMatches1("SET|RESET")&& !TailMatches3("UPDATE",MatchAny,"SET"))
27062709
COMPLETE_WITH_QUERY(Query_for_list_of_set_vars);
27072710
elseif (Matches1("SHOW"))
27082711
COMPLETE_WITH_QUERY(Query_for_list_of_show_vars);
@@ -2743,8 +2746,12 @@ psql_completion(const char *text, int start, int end)
27432746
/* Complete SET <var> with "TO" */
27442747
elseif (Matches2("SET",MatchAny))
27452748
COMPLETE_WITH_CONST("TO");
2749+
/* Complete ALTER DATABASE|FUNCTION|ROLE|USER ... SET <name> */
2750+
elseif (HeadMatches2("ALTER","DATABASE|FUNCTION|ROLE|USER")&&
2751+
TailMatches2("SET",MatchAny))
2752+
COMPLETE_WITH_LIST2("FROM CURRENT","TO");
27462753
/* Suggest possible variable values */
2747-
elseif (Matches3("SET",MatchAny,"TO|="))
2754+
elseif (TailMatches3("SET",MatchAny,"TO|="))
27482755
{
27492756
/* special cased code for individual GUCs */
27502757
if (TailMatches2("DateStyle","TO|="))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp