【问题标题】:Postgres Query Timing out after 30 SecondsPostgres 查询在 30 秒后超时
【发布时间】:2020-04-08 19:27:24
【问题描述】:

有一个查询会在 30 秒后保持超时。我在 Stackoverflow 上看到了一些与我面临的问题相似的帖子,唯一让我的问题不同的是,我没有使用 DSN-LESS 连接,我使用的是 ODBC ADMINISTRATOR。

以下错误是我收到的错误:

16:33:16.06 System.Data.Odbc.OdbcException (0x80131937): ERROR [57014] ERROR: 由于语句超时而取消语句;

我想我的问题是,如何使用 ODBC 管理器增加连接超时?

任何帮助将不胜感激

【问题讨论】:

    标签: postgresql odbc connection-string pgadmin


    【解决方案1】:

    您可以尝试在每个数据库会话中运行类似于:

    postgres=# set statement_timeout='300s';
    SET
    postgres=# show statement_timeout;
     statement_timeout 
    -------------------
     5min
    (1 row)
    

    postgres=#

    为避免在每个数据库会话中这样做,在 postgresql.conf 中更改此参数会更容易:将为所有数据库会话启用新设置。

    【讨论】:

    • 谢谢你!我已经考虑过这个选项,但是,显然,不建议在 postgresql.conf 中设置 statement_timeout,因为它会影响所有会话!
    猜你喜欢
    • 1970-01-01
    • 2011-11-13
    • 2021-10-25
    • 2014-03-02
    • 1970-01-01
    • 2020-09-02
    • 1970-01-01
    • 1970-01-01
    • 2015-11-14
    相关资源
    最近更新 更多