diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-03-13 19:52:48 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-03-13 19:52:48 -0400 |
commit | 369398ed886dc13956654777467536625e6fc7ee (patch) | |
tree | 57e03e2331f82752c885d37c1f5759430aaf8c46 /src | |
parent | 6e20f4600a420961817ce743be454080745f84d1 (diff) | |
download | postgresql-369398ed886dc13956654777467536625e6fc7ee.tar.gz postgresql-369398ed886dc13956654777467536625e6fc7ee.zip |
Fix bogus tab-completion queries.
My (tgl's) thinko in commit 02b8048ba: I forgot that the first
argument of COMPLETE_WITH_QUERY_PLUS is a format string, and
hence failed to double a literal %. These two places seem to
be the only ones that are wrong, though.
Vignesh C
Discussion: https://postgr.es/m/CALDaNm0hBO+tZqBWhBjTVxyET1GWANq5K9XpQ07atSxnFXbG7w@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/tab-complete.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 6957567264a..6d5c928c100 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -1811,7 +1811,7 @@ psql_completion(const char *text, int start, int end) COMPLETE_WITH("(", "ALL TABLES IN SCHEMA", "TABLE"); else if (Matches("ALTER", "PUBLICATION", MatchAny, "ADD|DROP|SET", "ALL", "TABLES", "IN", "SCHEMA")) COMPLETE_WITH_QUERY_PLUS(Query_for_list_of_schemas - " AND nspname NOT LIKE E'pg\\\\_%'", + " AND nspname NOT LIKE E'pg\\\\_%%'", "CURRENT_SCHEMA"); /* ALTER PUBLICATION <name> SET ( */ else if (HeadMatches("ALTER", "PUBLICATION", MatchAny) && TailMatches("SET", "(")) @@ -2956,7 +2956,7 @@ psql_completion(const char *text, int start, int end) */ else if (Matches("CREATE", "PUBLICATION", MatchAny, "FOR", "ALL", "TABLES", "IN", "SCHEMA")) COMPLETE_WITH_QUERY_PLUS(Query_for_list_of_schemas - " AND nspname NOT LIKE E'pg\\\\_%'", + " AND nspname NOT LIKE E'pg\\\\_%%'", "CURRENT_SCHEMA"); else if (Matches("CREATE", "PUBLICATION", MatchAny, "FOR", "ALL", "TABLES", "IN", "SCHEMA", MatchAny) && (!ends_with(prev_wd, ','))) COMPLETE_WITH("WITH ("); |