Skip to content

Commit 6b8c99c

Browse files
committed
psql: Improve tab completion of WITH
Only match when WITH is the first word, as WITH may appear in many other contexts. Josh Kupershmidt
1 parent 0d9819f commit 6b8c99c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/bin/psql/tab-complete.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2842,7 +2842,10 @@ psql_completion(char *text, int start, int end)
28422842
COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL);
28432843

28442844
/* WITH [RECURSIVE] */
2845-
else if (pg_strcasecmp(prev_wd, "WITH") == 0)
2845+
/* Only match when WITH is the first word, as WITH may appear in many other
2846+
contexts. */
2847+
else if (pg_strcasecmp(prev_wd, "WITH") == 0 &&
2848+
prev2_wd[0] == '\0')
28462849
COMPLETE_WITH_CONST("RECURSIVE");
28472850

28482851
/* ANALYZE */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy