Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o816O-0004Bd-Hw for pgsql-bugs@arkaria.postgresql.org; Sun, 03 Jul 2022 15:01:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o816M-0006Nl-QH for pgsql-bugs@arkaria.postgresql.org; Sun, 03 Jul 2022 15:01:34 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o816M-0006Nc-IR for pgsql-bugs@lists.postgresql.org; Sun, 03 Jul 2022 15:01:34 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o816K-00021f-Cw for pgsql-bugs@lists.postgresql.org; Sun, 03 Jul 2022 15:01:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 263F1KZo1216664; Sun, 3 Jul 2022 11:01:21 -0400 From: Tom Lane To: teng_wang13@163.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17537: Dynamically updating statement_timeout not affect the insert query right now. In-reply-to: <17537-9c5b29383602bca0@postgresql.org> References: <17537-9c5b29383602bca0@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sun, 03 Jul 2022 05:24:10 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1216662.1656860480.1@sss.pgh.pa.us> Date: Sun, 03 Jul 2022 11:01:20 -0400 Message-ID: <1216663.1656860480@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > However, dynamically updating statement_timeout did not affect the insert > query right now. > I start up Postgres with statement_timeout set 0, which means disabling the > timeout. Then I insert 100000000 rows into a table, which finally takes > 166498.487ms. During the insert operation, I consider the operation would > takes too much time. So I update statement_timeout to 10s in > postgresql.conf, and "select pg_reload_conf();" in another session to reload > configuration files. This is not a bug. Active sessions absorb new values from postgresql.conf only when idle, not instantaneously mid-query (and I'm pretty sure that is documented, though I'm too lazy to search the docs right now). I think trying to do the latter would break far more scenarios than it would improve. regards, tom lane