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
In short, when using schemas (dbplyr::in_schema) & PostgreSQL, the table name parameter isn't properly built when calling underlying functions. In my case, I'm trying to use the new dbplyr::rows_insert suite of functions.
Notice the paste0 call, this effectively creates something akin to the following when a schema is used:
>name<-dbplyr::in_schema("my_schema", "my_table")
> paste0("SELECT * FROM ", name)
[1] "SELECT * FROM my_schema""SELECT * FROM my_table"
And naturally the error is produced:
>DBI::dbSendQuery(conn, c("SELECT * FROM my_schema", "SELECT * FROM my_table"))
Error:Expectingasinglestringvalue: [type=character; extent=2].
I do not know at which point the schema'd name should be built, whether that should be earlier in the stack or not, but I'm fairly sure that it is the cause of the problem.
The text was updated successfully, but these errors were encountered:
avsdev-cw
changed the title
dbplyr:::get_col_types.PqConnection can't handle schemas
dbplyr:::get_col_types.PqConnection doesn't handle schemas
Feb 7, 2023
>name<-dbplyr:::remote_name(db_cars)
>con<-dbplyr::remote_con(db_cars)
# as per dbplyr:::get_col_types.PqConnection(con, name, call)> paste0("SELECT * FROM ", dbplyr::as.sql(name, con))
[1] "SELECT * FROM \"my_schema\".\"cars\""
I'm not sure how many instances of this bug might have been added....
In short, when using schemas (
dbplyr::in_schema
) & PostgreSQL, the table name parameter isn't properly built when calling underlying functions. In my case, I'm trying to use the newdbplyr::rows_insert
suite of functions.About as close to a reprex as I can produce:
The error I get is:
In the function stack I have traced the issue to:
Notice the
paste0
call, this effectively creates something akin to the following when a schema is used:And naturally the error is produced:
I do not know at which point the schema'd name should be built, whether that should be earlier in the stack or not, but I'm fairly sure that it is the cause of the problem.
The text was updated successfully, but these errors were encountered: