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 1sPaVq-005J6G-3k for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 04:25:34 +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 1sPaVo-005rNL-2I for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 04:25:32 +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 1sPaVm-005rNC-OM for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 04:25:32 +0000 Received: from fout8-smtp.messagingengine.com ([103.168.172.151]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sPaVk-000TSt-8B for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 04:25:30 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfout.nyi.internal (Postfix) with ESMTP id C8EFD138006E; Fri, 5 Jul 2024 00:25:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 05 Jul 2024 00:25:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1720153526; x=1720239926; bh=Em3ZFu9SjbpN1SpdFbuQIuBTIYyf6frmBLVVnHFjLB4=; b= Sl6Ae/Vw3bgJdcLgpKRbpqBTJ9FACTOG/hHJhFkMTW2YNGruNJ/UWI4j31xjqN38 jVK39koV6O4fZC2YHCJ3oFmsQREZHKVi76MAukCKHYkPIdU2fgyypN3aDv3Aa5Tn zn74WH6IaY2QLM5VlfcF2LWqY5ZhwJF1IdYs02ih9cA12e1rHyPLPJPX2b8s9uK6 JpuMM3GUVCHAwtt2CPNX4NaUvJgBRiQd0ldxAxx6M9vl5NSowbUI2u/Mbr12lAy1 1gdhOti2Fswf2lV8autT5pW+w2z4zsqsnSKFGJ9jBtyVG0tHBjnq3b8IKMuR7mTI H9SZKTxV/Pfk0T+ldqLM9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1720153526; x= 1720239926; bh=Em3ZFu9SjbpN1SpdFbuQIuBTIYyf6frmBLVVnHFjLB4=; b=A y1vYzNmxAjQZSIvpIB8ZO1riA9cSz39yfBP3uW9ySg84rzU214avo9OaIpJnu6gF iNL8eP9jEFBB6rVpI1MX3cC40SVo4A1XfIpdGPSHa15H0KcNrEFpbyI2wqk2/l1v AjHVcaRXPlaGpQwHegvRtWkLWt95P1CODlDid2s4ksh7nxW1sbCV6z7QhWwOQAnd Y5qa8iXM28/uG9UvJqVB1vMfTPZg5hb2UZ7irkERDV0tOnssFxgj9U780bTv+wLZ G3CBhX0R3QTFeA+bCDaagKe3Vrkz0//vSzMXPspKH7amxeHetXFNYwXkb9XN5k0/ mZ1Cq3kW4B9utU/MEd7qw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddtgdekudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeetughrihgr nhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh eqnecuggftrfgrthhtvghrnhepkeefheduvdejiefgieefjedtudduffelvdefleehfedt ieffuefgvdekleegtddvnecuffhomhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenuc evlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughrihgr nhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 5 Jul 2024 00:25:26 -0400 (EDT) Message-ID: <7d7aff89-cbf9-41da-8058-b7878817e22e@aklaver.com> Date: Thu, 4 Jul 2024 21:25:25 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: psql help To: Murthy Nunna , "pgsql-general@lists.postgresql.org" , "David G. Johnston" References: Content-Language: en-US From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 7/4/24 20:54, Murthy Nunna wrote: > Sorry, there is no problem with the following statement and the > environment variable. It works fine. But it terminates only one PID due > to LIMIT 1. I want to terminate all pids that meet this criteria. If I > remove LIMIT 1, pg_terminate_backend(pid) will not work as it expects > only one pid at a time. So, the question is how to rewrite this psql so > it loops through all pids one pid at a time? Thanks in advance for your > help. From here: https://www.postgresql.org/docs/current/app-psql.html See: \gexec -- Adrian Klaver adrian.klaver@aklaver.com