projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
| inline |
side by side
(parent:
a01f6fa
)
psql: Tab completion for JOIN ... USING column list
author
Tomas Vondra
<
[email protected]
>
Mon, 16 Dec 2024 17:12:29 +0000
(18:12 +0100)
committer
Tomas Vondra
<
[email protected]
>
Mon, 16 Dec 2024 17:47:03 +0000
(18:47 +0100)
For JOIN ... USING, offer attribute names for the first member of the
column list.
Author: Andreas Karlsson
Reviewed-By: Tomas Vondra
Discussion: https://postgr.es/m/
3a7e27bc
-d6ed-4cb0-9b21-
f21143fc1b37
@proxel.se
src/bin/psql/tab-complete.in.c
|
blob
|
blame
|
history
diff --git
a/src/bin/psql/tab-complete.in.c
b/src/bin/psql/tab-complete.in.c
index e9af7b37ac88e8dfc78a43d89259eed82139767b..31c77214b4f06ff107ea51bf826289bd4940d197 100644
(file)
--- a/
src/bin/psql/tab-complete.in.c
+++ b/
src/bin/psql/tab-complete.in.c
@@
-5179,6
+5179,10
@@
match_previous_words(int pattern_id,
TailMatches("JOIN", MatchAny, MatchAny, "USING") ||
TailMatches("JOIN", "LATERAL", MatchAny, MatchAny, "USING"))
COMPLETE_WITH("(");
+ else if (TailMatches("JOIN", MatchAny, "USING", "("))
+ COMPLETE_WITH_ATTR(prev3_wd);
+ else if (TailMatches("JOIN", MatchAny, MatchAny, "USING", "("))
+ COMPLETE_WITH_ATTR(prev4_wd);
/* ... AT [ LOCAL | TIME ZONE ] ... */
else if (TailMatches("AT"))