diff options
author | Michael Paquier <michael@paquier.xyz> | 2022-09-10 17:22:29 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2022-09-10 17:22:29 +0900 |
commit | 6afcab6ac1e03975dc59d62c3ccaf98ed2831669 (patch) | |
tree | af65ca0a0dffa3125f9e20d5e235bda133c5c103 /src | |
parent | 799437e0bd3259c90d26e195894b6e22eb0b325c (diff) | |
download | postgresql-6afcab6ac1e03975dc59d62c3ccaf98ed2831669.tar.gz postgresql-6afcab6ac1e03975dc59d62c3ccaf98ed2831669.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/tab-complete.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index a7eccc75d26..f3465adb855 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -2240,7 +2240,8 @@ psql_completion(const char *text, int start, int end) "ENABLE", "INHERIT", "NO", "RENAME", "RESET", "OWNER TO", "SET", "VALIDATE CONSTRAINT", "REPLICA IDENTITY", "ATTACH PARTITION", - "DETACH PARTITION", "FORCE ROW LEVEL SECURITY"); + "DETACH PARTITION", "FORCE ROW LEVEL SECURITY", + "OF", "NOT OF"); /* ALTER TABLE xxx ADD */ else if (Matches("ALTER", "TABLE", MatchAny, "ADD")) { @@ -2473,6 +2474,10 @@ psql_completion(const char *text, int start, int end) else if (Matches("ALTER", "TABLE", MatchAny, "DETACH", "PARTITION", MatchAny)) COMPLETE_WITH("CONCURRENTLY", "FINALIZE"); + /* ALTER TABLE <name> OF */ + else if (Matches("ALTER", "TABLE", MatchAny, "OF")) + COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_composite_datatypes); + /* ALTER TABLESPACE <foo> with RENAME TO, OWNER TO, SET, RESET */ else if (Matches("ALTER", "TABLESPACE", MatchAny)) COMPLETE_WITH("RENAME TO", "OWNER TO", "SET", "RESET"); |