diff options
Diffstat (limited to 'pgcli/pgcompleter.py')
-rw-r--r-- | pgcli/pgcompleter.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/pgcli/pgcompleter.py b/pgcli/pgcompleter.py index 79be274e..269b810f 100644 --- a/pgcli/pgcompleter.py +++ b/pgcli/pgcompleter.py @@ -491,11 +491,14 @@ class PGCompleter(Completer): def get_column_matches(self, suggestion, word_before_cursor): tables = suggestion.table_refs - do_qualify = suggestion.qualifiable and { - "always": True, - "never": False, - "if_more_than_one_table": len(tables) > 1, - }[self.qualify_columns] + do_qualify = ( + suggestion.qualifiable + and { + "always": True, + "never": False, + "if_more_than_one_table": len(tables) > 1, + }[self.qualify_columns] + ) qualify = lambda col, tbl: ( (tbl + "." + self.case(col)) if do_qualify else self.case(col) ) @@ -703,7 +706,11 @@ class PGCompleter(Completer): not f.is_aggregate and not f.is_window and not f.is_extension - and (f.is_public or f.schema_name == suggestion.schema) + and ( + f.is_public + or f.schema_name in self.search_path + or f.schema_name == suggestion.schema + ) ) else: |