Closed Dmitrii-I closed 6 years ago
Please try dbReadTable(conn, c('my_schema','my_table')), if you want to specify the schema.
RPostgreSQL have not come up with the latest DBI spec. and dbQuoteIdentifier is not used here, in fact. Because a table name containing a period "." is valid, schema.table shall not be interpreted as "schema"."table".
Also, note dbReadTable doc of DBI specify that the string should be processed with dbQuoteIdentifier, effectively making the same behavior.
Thanks, will do.
A typical database will have multiple schemas. Not everything resides in public schema.
When using
dbReadTable
and providing fully qualified table name because the schema is not on the search path, the functiondbQuoteIdentifier
returns "schema.table" instead of "schema"."table". This leads todbReadTable
failing:The documentation of
dbQuoteIdentifier
mentions that this function is used for column names. Note that dots in column names are treated differently than dots in table names! Perhaps don't usedbQuoteIdentifier
for table names ordbReadTable
should first split the table name on dots, then quote the parts, and return the parts pasted together.