<ruby id="xh9j9"></ruby>

<th id="xh9j9"></th>

    1. <rp id="xh9j9"><object id="xh9j9"></object></rp>
      <rp id="xh9j9"></rp>

        首頁 > 編程學習 > terminating connection due to idle-session timeout

        terminating connection due to idle-session timeout

        發布時間:8/16/2022 2:25:28 PM

        報錯信息

        psycopg2.databaseerror: terminating connection due to idle-session timeout

        官網文檔說明

        文檔

        官方不推薦在postgresql.conf中設置statement_timeout,因為它會影響所有會話。

        statement_timeout:
        中止任何使用了超過指定毫秒數的語句,從命令到達服務器開始計時。如果log_min_error_statement被設置為ERROR或更低,語句如果超時也會被記錄。一個零值(默認)將關閉這個參數。
        
        idle_in_transaction_session_timeout:
        終止任何已經閑置超過這個參數所指定的時間(以毫秒計)的打開事務的會話。 這使得該會話所持有的任何鎖被釋放,并且其所持有的連接槽可以被重用, 它也允許只對這個事務可見的元組被清理。
        

        解決方案

        在執行的sql前設置對于的值
        =to都一樣
        單位ms, s, min, h, and d

        -- 查看
        show statement_timeout;
        -- 設置(臨時)
        set statement_timeout to '4h';
        
        -- 查看
        show idle_in_transaction_session_timeout;
        -- 設置(臨時)
        set idle_in_transaction_session_timeout='1h';
        
        Copyright ? 2010-2022 wtld.cn 版權所有 |關于我們| 聯系方式
        日本精品人妻

        <ruby id="xh9j9"></ruby>

        <th id="xh9j9"></th>

        1. <rp id="xh9j9"><object id="xh9j9"></object></rp>
          <rp id="xh9j9"></rp>