【发布时间】:2019-04-05 20:07:33
【问题描述】:
我在 R 中运行一个代码,它连接到 postgresql 数据库。连接是在循环之外定义的,但它会超时并不断中断。如果我将连接放在循环中,并在每次使用时将其终止。我们达到了连接的限制。
此外,当我们在循环中运行 r 代码时,答案/输出将存储在数据库中,它在前 15 分钟内工作,但随后连接中断,说无法连接。
我收到以下错误:
RS-DBI driver: (could not connect ------ on dbname "abc": could not connect to server: Connection timed out (0x0000274C/10060)
Is the server running on host "123.456.567.890" and accepting
TCP/IP connections on port 5432?
)Error in diagnosticTestsPg(project_path, modelbank, modelproduct, modelwaterfall, :
object 'conn' not found
In addition: There were 50 or more warnings (use warnings() to see the first 50)
这里,conn是到数据库的连接
【问题讨论】:
标签: r postgresql connection