Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rmZhk-008hEX-5t for pgsql-general@arkaria.postgresql.org; Tue, 19 Mar 2024 13:40:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rmZhi-00EbEs-KU for pgsql-general@arkaria.postgresql.org; Tue, 19 Mar 2024 13:40:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rmZhi-00EbEC-BB for pgsql-general@lists.postgresql.org; Tue, 19 Mar 2024 13:40:34 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rmZhf-005KHX-BA for pgsql-general@lists.postgresql.org; Tue, 19 Mar 2024 13:40:33 +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 42JDeTCU3812229; Tue, 19 Mar 2024 09:40:29 -0400 From: Tom Lane To: "Abraham, Danny" cc: "pgsql-general@lists.postgresql.org" Subject: Re: set local statement_timeout within a stored procedure In-reply-to: References: Comments: In-reply-to "Abraham, Danny" message dated "Tue, 19 Mar 2024 12:59:38 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3812227.1710855629.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 19 Mar 2024 09:40:29 -0400 Message-ID: <3812228.1710855629@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "Abraham, Danny" writes: > Is there a way to integrate " set local statement_timeout" in a stored p= rocedure? Not usefully. statement_timeout bounds the time spent for a single command sent by the client. So by the time you're inside a procedure, the countdown is already running (or not) for the current command, and it's too late to change it with effect for that command. regards, tom lane