I try to drop tables in an scheme their names begin with digits from R. The tables exist in a postgress data bank.
library(RPostgreSQL)
library(DBI)
pg = dbDriver("PostgreSQL")
con = dbConnect(pg, user= ....)
dbGetQuery(con,paste0("DROP TABLE frc_rm.",'"30062020RB"',";"))
where con containes the login information. However, the command cannot be executed!
In postgresqlQuickSQL(conn, statement, ...) :
Could not create execute: DROP TABLE frc_rm."30062020RB";
any idea what could be the solution?
dbExecute(conn, 'DROP TABLE frc_rm."30062020RB"')? Can you run the same command in Postgres using the same user as in R? User may not have create/drop table privileges.