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

Lines changed: 6 additions & 1 deletion
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)
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