Skip to content

Commit a7c4dad

Browse files
committed
Fix psql's tab completion for ALTER DATABASE ... SET TABLESPACE.
We have the infrastructure to offer a list of tablespace names, but it wasn't being used here; instead you got "FROM", "CURRENT", and "TO" which aren't actually legal in this syntax. Dagfinn Ilmari Mannsåker, reviewed by Arthur Zakirov Discussion: https://postgr.es/m/d8jo9djvm7h.fsf@dalvik.ping.uio.no
1 parent 1dba1b6 commit a7c4dad

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bin/psql/tab-complete.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1588,6 +1588,10 @@ psql_completion(const char *text, int start, int end)
15881588
"IS_TEMPLATE", "ALLOW_CONNECTIONS",
15891589
"CONNECTION LIMIT");
15901590

1591+
/* ALTER DATABASE <name> SET TABLESPACE */
1592+
else if (Matches5("ALTER", "DATABASE", MatchAny, "SET", "TABLESPACE"))
1593+
COMPLETE_WITH_QUERY(Query_for_list_of_tablespaces);
1594+
15911595
/* ALTER EVENT TRIGGER */
15921596
else if (Matches3("ALTER", "EVENT", "TRIGGER"))
15931597
COMPLETE_WITH_QUERY(Query_for_list_of_event_triggers);

0 commit comments

Comments
 (0)