Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 7FD169FA499 for ; Mon, 15 Oct 2007 14:35:04 -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 36032-08 for ; Mon, 15 Oct 2007 14:34:51 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from el-out-1112.google.com (el-out-1112.google.com [209.85.162.181]) by postgresql.org (Postfix) with ESMTP id 6DDC19F9AB7 for ; Mon, 15 Oct 2007 14:34:52 -0300 (ADT) Received: by el-out-1112.google.com with SMTP id r27so356951ele for ; Mon, 15 Oct 2007 10:34:51 -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=ZjWim4hvqKESt+J7TJ+uBSBMGpkmcm81QJfREsaVcFU=; b=FPRu24+HCdmQ1ac8CCktQDi4YCWBowyRxQhOtJawQb2vISWjqKWq5C2AqJNaAFpz73dpm4oD5V39c6+1H2zqU5Oq18E2yGcGNqNyQ1f35K4Df6TRqeTiWhCVl807anxiDNXKiQOznja57Yc53WS3YpzwEonhN3WLZQqcyReDwEI= 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=uLu1ikp+jSjr4inbYLL9eZTdHyXjbbvr9speDConm0Qq6UsXGejAedEpar8jrhfRKSMFeXsymxVzxTSK6BxyKn9exFNnv89sSiPzegjpeIHGjSSH5R7zke6PeIlF7+/SvXLSXXmtAxC6osQe3BnFl1HVllCsB2Tf4H8GGSb4ezc= Received: by 10.142.99.21 with SMTP id w21mr1620539wfb.1192469690527; Mon, 15 Oct 2007 10:34:50 -0700 (PDT) Received: by 10.143.8.5 with HTTP; Mon, 15 Oct 2007 10:34:50 -0700 (PDT) Message-ID: <36e682920710151034r2aaef401m5429e460ee0ac209@mail.gmail.com> Date: Mon, 15 Oct 2007 13:34:50 -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: "Tommy Gildseth" , pgsql-admin@postgresql.org In-Reply-To: <382292.68410.qm@web56406.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <471369C9.1060301@usit.uio.no> <382292.68410.qm@web56406.mail.re3.yahoo.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200710/126 X-Sequence-Number: 27040 On 10/15/07, Jessica Richard wrote: > Thanks a lot! > > "select pg_cancel_backend(procpid) " can end the current query for that > user, but then this connection becomes IDLE, still connected. > > Is there a command for me to totally disconnect a user by procpid? Some > times, I need to kick out a particular Postgres user completely. There used to be a pg_terminate_backend, but it was #ifdef'd out due to corruption concerns. Basically, all it did was: kill -TERM pid I'm not sure whether anyone has completed the research required to know if anything remains corrupted, but it is used occasionally. Best to do pg_cancel_backend and then kill -TERM. -- 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/