Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id F04CC64FC12 for ; Mon, 22 Sep 2008 10:48:47 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 76167-09 for ; Mon, 22 Sep 2008 10:48:41 -0300 (ADT) X-Greylist: delayed 00:05:05.83772 by SQLgrey-1.7.6 Received: from mail.digitalfreaks.org (arbitor.digitalfreaks.org [216.151.95.158]) by postgresql.org (Postfix) with ESMTP id D976E64FC21 for ; Mon, 22 Sep 2008 10:48:41 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mail.digitalfreaks.org (Postfix) with ESMTP id 9672E1840C for ; Mon, 22 Sep 2008 09:43:31 -0400 (EDT) Received: from mail.digitalfreaks.org ([127.0.0.1]) by localhost (mail.digitalfreaks.org [127.0.0.1]) (amavisd-maia, port 10024) with ESMTP id 32975-33 for ; Mon, 22 Sep 2008 09:43:30 -0400 (EDT) Received: from [192.168.2.161] (pr40.pitbpa0.pub.collaborativefusion.com [206.210.89.202]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.digitalfreaks.org (Postfix) with ESMTPSA id 39B0D1840B for ; Mon, 22 Sep 2008 09:43:30 -0400 (EDT) Subject: SIGKILL and force disconnecting user sessions From: "Brian A. Seklecki" To: pgsql-admin@postgresql.org Content-Type: text/plain Date: Mon, 22 Sep 2008 09:43:29 -0400 Message-Id: <1222091009.3153.84.camel@soundwave.ws.pitbpa0.priv.collaborativefusion.com> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 (2.22.3.1-1.fc9) Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.2 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/225 X-Sequence-Number: 30318 This one really isn't in the docs, so we'll add it to the Wiki afterwords, but: We've got some shared PG instances with more than one production application (yes, I know this is a bad practice, but virtualization options are hit and miss). We need to kill apache P-conn pools from a an application/web server cluster for a specific database. We use a load-balancer, so we shut down the HA L4 Service VIP that the web servers pconnect() to, to prevent new incoming connections. The problem is then net.inet.tcp.* timeouts. We need to cane existing connections with a quickness, and pg_stat_activity is a read-only view. We need to kill the stale pcons, so just: $ pkill -a [database string] The connection goes away as "Disconnected per admin command" I just want to confirm: 1) There are no data consistency threats to SIGKIL a child thread process? Transactions and locks will be handled gracefully? 2) There are no pgsql/admin level CLI builtin commands to do this in a more graceful manor?