From d20cdd31c0f0cd2d94ecb6a5dff4d1f183106541 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 26 Jul 2012 10:16:55 -0400 Subject: [PATCH] Tab complete table names after ALTER TABLE x [NO] INHERIT. Jeff Janes --- src/bin/psql/tab-complete.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 6b5dd4978f..a1bb230d6b 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)