psql: Tab completion for LATERAL joins
authorTomas Vondra <tomas.vondra@postgresql.org>
Mon, 16 Dec 2024 16:55:00 +0000 (17:55 +0100)
committerTomas Vondra <tomas.vondra@postgresql.org>
Mon, 16 Dec 2024 17:47:03 +0000 (18:47 +0100)
When listing selectable objects after a JOIN, offer also LATERAL.

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

index 9e23272fc0e76280431fd800d05cf63d355c756d..6a9c5e240fb06460aa66069f9e6b952f5c3a862d 100644 (file)
@@ -5166,7 +5166,7 @@ match_previous_words(int pattern_id,
 
 /* ... JOIN ... */
    else if (TailMatches("JOIN"))
-       COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_selectables);
+       COMPLETE_WITH_SCHEMA_QUERY_PLUS(Query_for_list_of_selectables, "LATERAL");
 
 /* ... AT [ LOCAL | TIME ZONE ] ... */
    else if (TailMatches("AT"))