-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
materialized views in dbListTables() #251
Comments
Probably a better implementation and one that is closer to the current one: SELECT c.relname AS name
FROM pg_class AS c
JOIN pg_namespace AS n
ON c.relnamespace = n.oid
WHERE (n.nspname = ANY (current_schemas(true)))
AND (n.nspname <> 'pg_catalog')
AND (relkind IN ('r', 'p', 'f', 'v', 'm'))
AND NOT relispartition
ORDER BY name This also includes foreign and partitioned tables like
|
Thanks. This sounds like a useful extension. Would you like to submit a pull request? |
use pg_class/pg_namespace instead of information_schema.tables
I submitted a PR for I assume that |
Thanks for the PR. Yes, we should support all methods.
|
If you prefer staying in line with your pull request and use Postgres-specific internal views, we need to rewrite so that all use cases of |
use pg_class/pg_namespace instead of information_schema.tables
Ancient dplyr issue: tidyverse/dplyr#1007. |
Should Materialized Views be listed by
dbListTables()
?I'd argue they should since they are objects that share characteristics of both Tables and Views, both of which are returned by
dbListTables()
, see #27 & #29.See this thread on the psql-hackers list for a discussion on why they are not in the
INFORMATION_SCHEMA.tables
(which includes Views). Tl;dr: "They are not defined by the SQL standard." I see this as a relatively minor point w.r.t. RPostgres, though.As it stands there is no helper function like
dbListTables()
to list Materialized Views in RPostgres.The following query shows all Tables, Views and Materialized Views (I have not looked into temporary tables, yet):
The text was updated successfully, but these errors were encountered: