Closed dsedivec closed 5 years ago
Yes. This is the result of the bugfix:
https://github.com/dbcli/pgspecial/pull/80
That fixed a very annoying problem:
https://github.com/dbcli/pgcli/issues/1086
We could lazily load completions for tables that are not in search path. I have no bandwidth for this right now, perhaps other @dbcli/pgcli-core members could pick it up. Feel free to submit a PR if you feel up to it!
Steps to reproduce:
Set up a test DB (e.g. via pgcli or psql):
Try to
\d foo.bar
Expected results: pgcli shows the definition of table
foo.bar
Observed results: pgcli presents the error,
Did not find any relation named foo.bar.
Below is a transcript from a pgcli session. You can see that
\dt foo.bar
works fine, but\d foo.bar
fails until I putfoo
intosearch_path
.I strongly suspect the problem is dbcommands.py line 691 which adds
pg_catalog.pg_table_is_visible(c.oid)
to the query.pg_table_is_visible
has the description, "is table visible in search path?"The complete query pgcli generated is (reformatted for your pleasure):
If I comment out the
pg_table_is_visible
condition, this query successfully returns the one row you'd expect.For comparison, here's the first query my psql generates in response to
\d foo.bar
in the same DB (again, reformatted):Versions:
Thanks to everyone who works on pgcli, I'm enjoying using it!