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 1sPbMD-005NEJ-H9 for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 05:19:41 +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 1sPbMB-006G1F-8m for pgsql-general@arkaria.postgresql.org; Fri, 05 Jul 2024 05:19:39 +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 1sPbMA-006G13-U4 for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 05:19:39 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sPbM8-000Tmx-Td for pgsql-general@lists.postgresql.org; Fri, 05 Jul 2024 05:19:38 +0000 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3c9cc681ee7so483594b6e.1 for ; Thu, 04 Jul 2024 22:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720156776; x=1720761576; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=WVNzytTxMunq6+swWCZl+kUf1Y3JhJIu3HyE9zoALYU=; b=jyz96yX+sm9uflSTytm9XJZptbetrVY3Mz+p5h9adpJOxZ8Z6SgkVE48FSGFyRX+Wb ZFLXQhSxmy/yR0Evbg+B4ybycQb3r4Y+fFbh7mZpuwy5vfeEoKvnmn+rK91ZZ4UmjoZ/ AFasU1wsZkvsYb+sMHU8ZSdEQWmkBvR5byrYPEae49gJXaRDP7A3B8zcmCkxRDQwlLKU LSoLzwuM2GMC+tUDswno1xhZzgjNpMoBom4kdWRnDIBQuVS3/E/SX/0Kp921fZ1TQ6L8 Exat/187YBZAIGb412re3pVYDOFYwUow3eZxLniie72iCV/qmX9w5oUOZKI83KnNfh52 mBgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720156776; x=1720761576; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=WVNzytTxMunq6+swWCZl+kUf1Y3JhJIu3HyE9zoALYU=; b=imF2dazFz6ay91ZWJ3fA1GGpq+lSgcnZZVamwO30VXpS5RXGQfHVR5+8xgDmeuXwR+ C8V/7yGDgLE29T0YusSPe4PejFKeRmRaA+NfDAAxgr1GUHczqqeU4CxgApdwFkMoT0PX 0n2NLEp2et0wQkm0viMWvXG2WDhkyz8YlErgYcja93J03XEIRfYtJV0VeVeUZjkhoUEH /uANc1N90Qvx8ZphW890RQcvD5tOnh1fCn58/XHPvmr6adAP3hELOVBe4cw2OZlsWpUJ JRU6Y8qfSagp8Sv0ALtkldS5nsVA7DRqsJyIuQEV/OTTqMHBmDh0FmRS7qKwLyEZswe7 S/gw== X-Gm-Message-State: AOJu0YyfV+RFSUqqZ2N/OTIOR0RL6J1wnHtImWf19nwH96V9gN8OpxwA ar4JFM/ctfiv76YtK59O4zsvQ7leJ7X53ieT4RfXjxZjtMqTEtK6SUFN/LZF6ANhQwj8SrBoyfJ 0eR1so+CwsoQyiSXmQIsoqWU5/Xg= X-Google-Smtp-Source: AGHT+IEz+Kh9UijQGrfXlOhiVvSYc1tO66m9Vmnkh4VBnwfm8t3o8eIEYjk5JBPvjzUEytyWF5fhnO1NfEK+2lY6Otw= X-Received: by 2002:a05:6808:199f:b0:3d5:66e8:ae91 with SMTP id 5614622812f47-3d915aecd0amr1472635b6e.4.1720156776086; Thu, 04 Jul 2024 22:19:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac9:6850:0:b0:539:aa10:6c7 with HTTP; Thu, 4 Jul 2024 22:19:35 -0700 (PDT) In-Reply-To: References: From: "David G. Johnston" Date: Thu, 4 Jul 2024 22:19:35 -0700 Message-ID: Subject: Re: psql help To: Murthy Nunna Cc: "pgsql-general@lists.postgresql.org" Content-Type: multipart/alternative; boundary="00000000000098c534061c79356b" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000098c534061c79356b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable The convention here is to in-line replies, or bottom-post. Top-posting makes the archives more difficult to read. On Thursday, July 4, 2024, Murthy Nunna wrote: > pg_terminate_backend(pid) will not work as it expects only one pid at a > time. > > > Interesting=E2=80=A6I wouldn=E2=80=99t expect the function calls to inter= act that way=E2=80=A6maybe try putting the select query into a plpgsql DO command lo= op and then call pg_terminate_backend once per loop iteration. > So, the question is how to rewrite this psql so it loops through all pids > one pid at a time? > > I can=E2=80=99t tell if you really mean the psql program or are misusing = the term to mean something different=E2=80=A6the code you wrote doesn=E2=80=99t seem= like it would execute in psql. David J. --00000000000098c534061c79356b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
The convention here is to in-line replies, or bottom-post.=C2=A0 Top-p= osting makes the archives more difficult to read.

On Th= ursday, July 4, 2024, Murthy Nunna <m= nunna@fnal.gov> wrote:

pg_terminate_backen= d(pid) will not work as it expects only one pid at a time.=C2=A0

=


Interesting=E2=80=A6I = wouldn=E2=80=99t expect the function calls to interact that way=E2=80=A6may= be try putting the select query into a plpgsql DO command loop and then cal= l pg_terminate_backend once per loop iteration.
=C2=A0

So, the question is how to = rewrite this psql so it loops through all pids one pid at a time?

I can=E2=80=99t t= ell if you really mean the psql program or are misusing the term to mean so= mething different=E2=80=A6the code you wrote doesn=E2=80=99t seem like it w= ould execute in psql.

David J.

--00000000000098c534061c79356b--