diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2012-04-10 20:35:39 +0300 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2012-04-10 20:35:39 +0300 |
commit | 6b8c99c386d318b434829ac0c9ba935fb5e53d18 (patch) | |
tree | 765ec3fa438e7ee9f84f06cedd367a4314d6978a /src | |
parent | 0d9819f7e3be3c4186f0398d007d2fef8809da6a (diff) | |
download | postgresql-6b8c99c386d318b434829ac0c9ba935fb5e53d18.tar.gz postgresql-6b8c99c386d318b434829ac0c9ba935fb5e53d18.zip |
psql: Improve tab completion of WITH
Only match when WITH is the first word, as WITH may appear in many
other contexts.
Josh Kupershmidt
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/tab-complete.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index d113adff033..00df2c6197b 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -2842,7 +2842,10 @@ psql_completion(char *text, int start, int end) COMPLETE_WITH_SCHEMA_QUERY(Query_for_list_of_tables, NULL); /* WITH [RECURSIVE] */ - else if (pg_strcasecmp(prev_wd, "WITH") == 0) + /* Only match when WITH is the first word, as WITH may appear in many other + contexts. */ + else if (pg_strcasecmp(prev_wd, "WITH") == 0 && + prev2_wd[0] == '\0') COMPLETE_WITH_CONST("RECURSIVE"); /* ANALYZE */ |