Jira issue originally created by user @beberlei:
The Postgres Schema code is very hard to read and inconsistent across the board. Some use pgclass, some pgtables. Namespaces /Schema are not always properly checked for. There should be a really unified way on how to approach schema query issues.
Comment created by ddebernardy:
I'm not sure what this ticket is about exactly, but...
"Namespaces /Schema are not always properly checked for."
Usually, one would not want to specify them and set the searchpath instead. Or are you meaning the schema analysis queries used internally? (If so, yes, it kind of sucks in that case, but note that there are a bunch of *_is_visible() methods, e.g. pg_catalog.pg_table_isvisible(rel.oid) which will strip out invisible schemas directly. This may be simpler than injecting schema references all over the place in that it also processes permissions.)
Also, note that PG has a whole bunch of pgcatalog views, which are available in the informationschema.