diff options
author | Tom Lane | 2004-12-24 15:42:05 +0000 |
---|---|---|
committer | Tom Lane | 2004-12-24 15:42:05 +0000 |
commit | 9405e14e00af7f02d39e617c934a7bcee3e95681 (patch) | |
tree | 5f5fe331eba0603bdc2582e22363a29d10872412 | |
parent | 0add759825e746c76671badfcf38c329ee7f151a (diff) |
Switch order of WHERE clauses in tab completion queries, as suggested
by Rod Taylor. The foo_is_visible() functions are relatively slow and
so it pays to check them after checking the name pattern match.
-rw-r--r-- | src/bin/psql/tab-complete.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c index 93f576a0bf4..8ebed5a3b7e 100644 --- a/src/bin/psql/tab-complete.c +++ b/src/bin/psql/tab-complete.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2004, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.118 2004/11/05 19:16:22 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/psql/tab-complete.c,v 1.119 2004/12/24 15:42:05 tgl Exp $ */ /*---------------------------------------------------------------------- @@ -1807,11 +1807,11 @@ _complete_from_query(int is_schema_query, const char *text, int state) if (completion_squery->selcondition) appendPQExpBuffer(&query_buffer, "%s AND ", completion_squery->selcondition); - appendPQExpBuffer(&query_buffer, "%s AND ", - completion_squery->viscondition); appendPQExpBuffer(&query_buffer, "substring(%s,1,%d)='%s'", completion_squery->result, string_length, e_text); + appendPQExpBuffer(&query_buffer, " AND %s", + completion_squery->viscondition); /* * When fetching relation names, suppress system catalogs |