postgresql - Postgres 查询在 30 秒后超时
问题描述
有一个查询会在 30 秒后保持超时。我在 Stackoverflow 上看到了一些与我面临的问题相似的帖子,唯一让我的问题不同的是,我没有使用 DSN-LESS 连接,我使用的是 ODBC ADMINISTRATOR。
以下错误是我收到的错误:
16:33:16.06 System.Data.Odbc.OdbcException (0x80131937):错误 [57014] 错误:由于语句超时而取消语句;
我想我的问题是,如何使用 ODBC Administrator 增加连接超时?
任何帮助,将不胜感激
解决方案
您可以尝试在每个数据库会话中运行类似于:
postgres=# set statement_timeout='300s';
SET
postgres=# show statement_timeout;
statement_timeout
-------------------
5min
(1 row)
postgres=#
为了避免在每个数据库会话中这样做,在 postgresql.conf 中更改此参数会更容易:将为所有数据库会话启用新设置。
推荐阅读
- reactjs - Promise.all 在循环控制台中显示数据但不将数据传递给状态
- javascript - 打字稿:从 Promise 继承
- apache-spark - pyspark 结构化流不使用 query.lastProgress 或其他标准指标更新查询指标
- windows - 如何更改我的应用程序的 Package.appxmanifest 文件以拒绝需要 RunFullTrust 模式?
- git - 如何将不同分支中的两个提交与 Android Studio 4.1 中的 Git 进行比较?
- racket - 将字符串映射到列表球拍
- javascript - ESLint 在默认导出功能时抱怨
- c++ - 为什么我的井字游戏逻辑有时会出错?
- git - Git:使用 git add * -A 时未暂存的更改
- mysql - io.vertx.mysqlclient.MySQLPool.query ("").execute 从未真正执行过并且什么也不返回