Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 5178E9FB2D7 for ; Tue, 16 Oct 2007 10:05:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 10492-04 for ; Tue, 16 Oct 2007 10:05:34 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.224]) by postgresql.org (Postfix) with ESMTP id 8C7B29FB358 for ; Tue, 16 Oct 2007 10:05:50 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id l8so1157835nzf for ; Tue, 16 Oct 2007 06:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=rFtXfD33vYbcEUq2OZfUdEysviEhutZqWrX7Fnnh3kg=; b=cNE8aYAxdB55dfQ4W1kQfkh8OBJOEo26ehFNBQKquiAFnk0Dj8HotydZ6O08L9L3y12t1t4N+sC/ljCZKeWPmQDfXCNDe8HHLkaSO536QSgWvaylIjZvxpoVA9d42CkmMc8+LPMxk1pUzd3lQ0HLJ70Tb7JrvSPTvRcnViJBkLc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=EYDiCr0C24iC3Bw8PIPZL+WkeF4X38MnjusB1Ali2fDPAKhXZwrmnjqQgWWMFfLUKgfp2nr3hLEx6CfC0lRpjfKNEtgZAFhy1014ernFuCrgMg57PgVCVo5Emm00H9g6mnKK7bJKWx7D7n7UY2vULWmDPHsAWlDPKVOiDSlmHjo= Received: by 10.142.213.9 with SMTP id l9mr1969161wfg.1192539948821; Tue, 16 Oct 2007 06:05:48 -0700 (PDT) Received: by 10.143.8.5 with HTTP; Tue, 16 Oct 2007 06:05:48 -0700 (PDT) Message-ID: <36e682920710160605n338de99fk300cd3062bd0417e@mail.gmail.com> Date: Tue, 16 Oct 2007 09:05:48 -0400 From: "Jonah H. Harris" To: "Jessica Richard" Subject: Re: Is there a way to kill a connection from the pg_stat_activitly list? Cc: "Scott Marlowe" , "Tommy Gildseth" , pgsql-admin@postgresql.org In-Reply-To: <379974.90208.qm@web56402.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <379974.90208.qm@web56402.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/143 X-Sequence-Number: 27057 On 10/16/07, Jessica Richard wrote: > select pg_cancel_backend(procpid) solved half of my problem...at least it > terminated the query for that user... but it is still holding a user > connection in IDLE state....If I have too many of those, Postgres may run of > out of user connections.... > > I already knew how to kill a connection if the connection is from the local > host. But I have many remote connections coming from different machines... > hard to kill with unix command "kill"... One time, I was testing to kill a > particular connection on a testing machine, the entrie Postgres was brought > down.... That's why I said to write a C stored procedure to do it and install it on the server. That way you could call it the same way as pg_cancel_backend. > I need to find a safer, cleaner way to disconnect a user from Postgres when > needed. At this point in time, there isn't one. -- Jonah H. Harris, Sr. Software Architect | phone: 732.331.1324 EnterpriseDB Corporation | fax: 732.331.1301 499 Thornall Street, 2nd Floor | jonah.harris@enterprisedb.com Edison, NJ 08837 | http://www.enterprisedb.com/