【问题标题】:Can not connect PostgreSQL(over SSL) with RPostgresql on Windows无法在 Windows 上将 PostgreSQL(通过 SSL)与 RPostgresql 连接
【发布时间】:2016-12-20 21:26:50
【问题描述】:

我无法将 PostgreSQL(在 Heroku 上)与 Windows(64 位)上的 RPostgreSQL 连接。

我可以在 Windows 上将本地 postgresql(不是 ssl)与 RPostgreSQL 连接起来。我可以从 Windows 上的 PgAdmin 连接 Heroku 上的 PostgreSQL。我可以将 Heroku 上的 PostgreSQL 与 OSX 和 Linux 上的 RPostgreSQL 连接起来。

只有 Windows 上的 RPostgreSQL 无法连接 Heroku PostgreSQL。

错误信息是:

Error in postgresqlNewConnection(drv, ...) : 
  RD-DBI driver: (could not connect....xxxxx

有什么解决办法吗?

【问题讨论】:

    标签: r windows ssl heroku rpostgresql


    【解决方案1】:

    与这个问题有关:Can't create dbConnect to Postgres with SSL。对我有用的一种解决方案(也适用于 Heroku DB)是改用 RPostgres 包。你可以安装开发。来自 Github 的版本:https://github.com/rstats-db/RPostgres.

    【讨论】:

    • RPostgres 是否比 RPostgreSQL 更易于维护?
    • 什么意思?唯一的缺点是您还不能从 CRAN 获得它,但它正在由 RStudio 人员(由 Hadley Wickham 领导)积极开发,因此它应该在中期拥有更多功能。
    • 我对“为什么”没有任何答案,但也可以确认Rpostgres也为我解决了这个问题。我没有使用 Heroku DB,而是使用 Aptible DB(类似于 Heroku,但符合 HIPAA)。有趣的是,dbConnect 包不需要指定 SSL,它“正常工作”。我已经编辑了 Philippe 的答案,为任何路人提供了一个工作代码块。
    • 在用 Rpostgresql 浪费了很多时间尝试连接到 Heroku 数据库之后,我尝试安装 Rpostgres 并解决了问题。安装此库时,可能会要求您将 R 工具安装到系统路径。如果这是一个问题在这里找到帮助:biostat.wisc.edu/~kbroman/Rintro/Rwinpack.html 和这里:github.com/stan-dev/rstan/wiki/Install-Rtools-for-Windows
    猜你喜欢
    • 2017-06-25
    • 1970-01-01
    • 2023-01-17
    • 2014-02-07
    • 1970-01-01
    • 2014-11-25
    • 2015-02-28
    • 2011-07-26
    • 2021-11-13
    相关资源
    最近更新 更多