我正在尝试使用模式下的ShinyR访问Redshift上的某些表,我可以使用库(RPostgresSQL)连接到不在模式下的表,所以我知道这部分正在工作:
pconn_r <- dbConnect(RPostgres::Postgres(),
host = "xxxxxxxxxxxx",
port = "5439",
user = "rcd_admin",
password = "xxxxxxx",
dbname = "xxxx"
)
但是我无法使用以下命令访问架构synapps下的表fr__synapps_drug__outpatient_index:
sql_command <- "Select cip13_code,cis_label,presentation_label,brand,period,hco_code,hco_label,hco_code_type,hco_city,bse,rem,unit from synapps.fr__synapps_drug__outpatient_index"
outpatient <- dbSendQuery(pconn_r, sql_command)
答案 0 :(得分:0)
我找到了解决方法:
myRedshift <- DBI::dbConnect(RPostgreSQL::PostgreSQL(),
dbname = 'oip',
host = 'xxxx',
port = 5439,
user = "xxxadmin",
password = "xxx")
cis_has_bdpm <-data.frame( dbGetQuery(myRedshift, "select * from synapps.fr__synapps_drug__has_index"))
我更改了连接Redshift的方式,并且可以正常工作,但是数据加载非常慢