Skip to content

Commit d20cdd3

Browse files
committed
Tab complete table names after ALTER TABLE x [NO] INHERIT.
Jeff Janes
1 parent d7318d4 commit d20cdd3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/bin/psql/tab-complete.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,21 @@ psql_completion(char *text, int start, int end)
12611261

12621262
COMPLETE_WITH_LIST(list_ALTERENABLE2);
12631263
}
1264+
/* ALTER TABLE xxx INHERIT */
1265+
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
1266+
pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
1267+
pg_strcasecmp(prev_wd, "INHERIT") == 0)
1268+
{
1269+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
1270+
}
1271+
/* ALTER TABLE xxx NO INHERIT */
1272+
else if (pg_strcasecmp(prev5_wd, "ALTER") == 0 &&
1273+
pg_strcasecmp(prev4_wd, "TABLE") == 0 &&
1274+
pg_strcasecmp(prev2_wd, "NO") == 0 &&
1275+
pg_strcasecmp(prev_wd, "INHERIT") == 0)
1276+
{
1277+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, "");
1278+
}
12641279
else if (pg_strcasecmp(prev4_wd, "ALTER") == 0 &&
12651280
pg_strcasecmp(prev3_wd, "TABLE") == 0 &&
12661281
pg_strcasecmp(prev_wd, "DISABLE") == 0)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy