mirror of
https://github.com/postgres/postgres.git
synced 2026-07-15 20:52:53 -04:00
psql: Add tab completion for DELETE ... USING.
This implements the tab completion that was marked as XXX TODO in the
source code. The following completion is now supported:
DELETE FROM <table> USING <TAB> -> list of relations supporting SELECT
This uses Query_for_list_of_selectables (instead of Query_for_list_of_tables)
because the USING clause can reference not only tables but also views and
other selectable objects, following the same syntax as the FROM clause
of a SELECT statement.
Author: Tatsuya Kawata <kawatatatsuya0913@gmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Reviewed-by: Soumya S Murali <soumyamurali.work@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAHza6qf0CLJuJr+5cQw0oWNebM5VyMB-ghoKBgnEjOQ_JtAiuw@mail.gmail.com
This commit is contained in:
parent
3b7a6fa157
commit
0bf7d4ca9a
1 changed files with 3 additions and 1 deletions
|
|
@ -4266,7 +4266,9 @@ match_previous_words(int pattern_id,
|
|||
/* Complete DELETE FROM <table> */
|
||||
else if (TailMatches("DELETE", "FROM", MatchAny))
|
||||
COMPLETE_WITH("USING", "WHERE");
|
||||
/* XXX: implement tab completion for DELETE ... USING */
|
||||
/* Complete DELETE FROM <table> USING with relations supporting SELECT */
|
||||
else if (TailMatches("DELETE", "FROM", MatchAny, "USING"))
|
||||
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_selectables);
|
||||
|
||||
/* DISCARD */
|
||||
else if (Matches("DISCARD"))
|
||||
|
|
|
|||
Loading…
Reference in a new issue