summaryrefslogtreecommitdiff
path: root/src/bin/psql/tab-complete.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/tab-complete.c')
-rw-r--r--src/bin/psql/tab-complete.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 2c368504ecf..4c468a858ce 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -741,10 +741,9 @@ psql_completion(char *text, int start, int end)
}
}
- /* ALTER CONVERSION,SCHEMA <name> */
+ /* ALTER SCHEMA <name> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
- (pg_strcasecmp(prev2_wd, "CONVERSION") == 0 ||
- pg_strcasecmp(prev2_wd, "SCHEMA") == 0))
+ pg_strcasecmp(prev2_wd, "SCHEMA") == 0)
{
static const char *const list_ALTERGEN[] =
{"OWNER TO", "RENAME TO", NULL};
@@ -752,6 +751,16 @@ psql_completion(char *text, int start, int end)
COMPLETE_WITH_LIST(list_ALTERGEN);
}
+ /* ALTER CONVERSION <name> */
+ else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
+ pg_strcasecmp(prev2_wd, "CONVERSION") == 0)
+ {
+ static const char *const list_ALTERGEN[] =
+ {"OWNER TO", "RENAME TO", "SET SCHEMA", NULL};
+
+ COMPLETE_WITH_LIST(list_ALTERGEN);
+ }
+
/* ALTER DATABASE <name> */
else if (pg_strcasecmp(prev3_wd, "ALTER") == 0 &&
pg_strcasecmp(prev2_wd, "DATABASE") == 0)
@@ -1237,17 +1246,22 @@ psql_completion(char *text, int start, int end)
pg_strcasecmp(prev3_wd, "SEARCH") == 0 &&
(pg_strcasecmp(prev2_wd, "TEMPLATE") == 0 ||
pg_strcasecmp(prev2_wd, "PARSER") == 0))
- COMPLETE_WITH_CONST("RENAME TO");
+ {
+ static const char *const list_ALTERTEXTSEARCH2[] =
+ {"RENAME TO", "SET SCHEMA", NULL};
+
+ COMPLETE_WITH_LIST(list_ALTERTEXTSEARCH2);
+ }
else if (pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
pg_strcasecmp(prev4_wd, "TEXT") == 0 &&
pg_strcasecmp(prev3_wd, "SEARCH") == 0 &&
pg_strcasecmp(prev2_wd, "DICTIONARY") == 0)
{
- static const char *const list_ALTERTEXTSEARCH2[] =
- {"OWNER TO", "RENAME TO", NULL};
+ static const char *const list_ALTERTEXTSEARCH3[] =
+ {"OWNER TO", "RENAME TO", "SET SCHEMA", NULL};
- COMPLETE_WITH_LIST(list_ALTERTEXTSEARCH2);
+ COMPLETE_WITH_LIST(list_ALTERTEXTSEARCH3);
}
else if (pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
@@ -1255,10 +1269,10 @@ psql_completion(char *text, int start, int end)
pg_strcasecmp(prev3_wd, "SEARCH") == 0 &&
pg_strcasecmp(prev2_wd, "CONFIGURATION") == 0)
{
- static const char *const list_ALTERTEXTSEARCH3[] =
- {"ADD MAPPING FOR", "ALTER MAPPING", "DROP MAPPING FOR", "OWNER TO", "RENAME TO", NULL};
+ static const char *const list_ALTERTEXTSEARCH4[] =
+ {"ADD MAPPING FOR", "ALTER MAPPING", "DROP MAPPING FOR", "OWNER TO", "RENAME TO", "SET SCHEMA", NULL};
- COMPLETE_WITH_LIST(list_ALTERTEXTSEARCH3);
+ COMPLETE_WITH_LIST(list_ALTERTEXTSEARCH4);
}
/* complete ALTER TYPE <foo> with actions */