Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6afcab6

Browse files
committed
Add psql tab compression for ALTER TABLE .. { OF | NOT OF }
ALTER TABLE .. OF is now able to complete with the list of available composite types that can be used with the query. Author: Aleksander Alekseev Reviewed-by: Shinya Kato Discussion: https://postgr.es/m/47b71e0c523b30357208e79786161281@oss.nttdata.com
1 parent 799437e commit 6afcab6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/bin/psql/tab-complete.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -2240,7 +2240,8 @@ psql_completion(const char *text, int start, int end)
22402240
"ENABLE", "INHERIT", "NO", "RENAME", "RESET",
22412241
"OWNER TO", "SET", "VALIDATE CONSTRAINT",
22422242
"REPLICA IDENTITY", "ATTACH PARTITION",
2243-
"DETACH PARTITION", "FORCE ROW LEVEL SECURITY");
2243+
"DETACH PARTITION", "FORCE ROW LEVEL SECURITY",
2244+
"OF", "NOT OF");
22442245
/* ALTER TABLE xxx ADD */
22452246
else if (Matches("ALTER", "TABLE", MatchAny, "ADD"))
22462247
{
@@ -2473,6 +2474,10 @@ psql_completion(const char *text, int start, int end)
24732474
else if (Matches("ALTER", "TABLE", MatchAny, "DETACH", "PARTITION", MatchAny))
24742475
COMPLETE_WITH("CONCURRENTLY", "FINALIZE");
24752476

2477+
/* ALTER TABLE <name> OF */
2478+
else if (Matches("ALTER", "TABLE", MatchAny, "OF"))
2479+
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_composite_datatypes);
2480+
24762481
/* ALTER TABLESPACE <foo> with RENAME TO, OWNER TO, SET, RESET */
24772482
else if (Matches("ALTER", "TABLESPACE", MatchAny))
24782483
COMPLETE_WITH("RENAME TO", "OWNER TO", "SET", "RESET");

0 commit comments

Comments
 (0)