You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to list tables in a specific schema using dbListTables and use syntax that will work with other DBI backends that support listing tables in a schema (e.g. odbc).
Just chiming in to say that this feature would be useful. I support some non-technical users who use dbplyr to access a database which is segregated by schema, and both these existing solutions are just a bit too complicated. My only neat workaround is to create a bunch of views in one schema just for them.
Activity
plpxsk commentedon Nov 1, 2022
Here is one way
In
DBI::dbConnect(), pass the following option:Or, to specify schema elsewhere:
Then, listing and writing tables should work directly on this connection
Source: https://stackoverflow.com/a/49110504/3217870
EDIT: minor edits
plpxsk commentedon Nov 1, 2022
An alternative is to list the "objects" (tables) in the schema:
Via https://stackoverflow.com/a/66717542/3217870
krlmlr commentedon Apr 1, 2023
Thanks.
The
optionsargument is documented in https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-PARAMKEYWORDS which is linked from https://rpostgres.r-dbi.org/reference/postgres#arguments-1. It's very powerful indeed.How can we improve the documentation to make this information easier to access?
Created on 2023-04-01 with reprex v2.0.2
SpikyClip commentedon Mar 4, 2025
Just chiming in to say that this feature would be useful. I support some non-technical users who use
dbplyrto access a database which is segregated by schema, and both these existing solutions are just a bit too complicated. My only neat workaround is to create a bunch of views in one schema just for them.