Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3429145

Browse files
committed
psql: Tab completion for JOIN ... USING column list
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
1 parent a01f6fa commit 3429145

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bin/psql/tab-complete.in.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5179,6 +5179,10 @@ match_previous_words(int pattern_id,
51795179
TailMatches("JOIN", MatchAny, MatchAny, "USING") ||
51805180
TailMatches("JOIN", "LATERAL", MatchAny, MatchAny, "USING"))
51815181
COMPLETE_WITH("(");
5182+
else if (TailMatches("JOIN", MatchAny, "USING", "("))
5183+
COMPLETE_WITH_ATTR(prev3_wd);
5184+
else if (TailMatches("JOIN", MatchAny, MatchAny, "USING", "("))
5185+
COMPLETE_WITH_ATTR(prev4_wd);
51825186

51835187
/* ... AT [ LOCAL | TIME ZONE ] ... */
51845188
else if (TailMatches("AT"))

0 commit comments

Comments
 (0)