aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2012-07-26 10:16:55 -0400
committerRobert Haas <rhaas@postgresql.org>2012-07-26 10:16:55 -0400
commitd20cdd31c0f0cd2d94ecb6a5dff4d1f183106541 (patch)
tree968caf4c425e2fa183d55138c8cd50ebf14711f8 /src
parentd7318d43d891bd63e82dcfc27948113ed7b1db80 (diff)
downloadpostgresql-d20cdd31c0f0cd2d94ecb6a5dff4d1f183106541.tar.gz
postgresql-d20cdd31c0f0cd2d94ecb6a5dff4d1f183106541.zip
Tab complete table names after ALTER TABLE x [NO] INHERIT.
Jeff Janes
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/tab-complete.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 6b5dd4978fe..a1bb230d6be 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -1261,6 +1261,21 @@ psql_completion(char *text, int start, int end)
COMPLETE_WITH_LIST(list_ALTERENABLE2);
}
+ /* ALTER TABLE xxx INHERIT */
+ else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
+ pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
+ pg_strcasecmp(prev_wd, "INHERIT") == 0)
+ {
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
+ }
+ /* ALTER TABLE xxx NO INHERIT */
+ else if (pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
+ pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
+ pg_strcasecmp(prev2_wd, "NO") == 0 &&
+ pg_strcasecmp(prev_wd, "INHERIT") == 0)
+ {
+ COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
+ }
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
pg_strcasecmp(prev_wd, "DISABLE") == 0)