From jdigital@cantv.net Wed May 11 20:08:27 2005 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 91C1553428 for ; Wed, 11 May 2005 17:08:27 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 78289-10 for ; Wed, 11 May 2005 20:08:10 +0000 (GMT) Received: from rs26s12.datacenter.cha.cantv.net (rs26s12.datacenter.cha.cantv.net [200.44.33.31]) by svr1.postgresql.org (Postfix) with ESMTP id 69ED652965 for ; Wed, 11 May 2005 17:08:07 -0300 (ADT) Received: from tgusta2 (dC85A71E0.dslam-21-1-18-10-2-02.fsl.dsl.cantv.net [200.90.113.224]) by rs26s12.datacenter.cha.cantv.net (8.13.0/8.13.0/3.0) with SMTP id j4BK81Fs015972 for ; Wed, 11 May 2005 16:08:05 -0400 X-Matched-Lists: [] Message-ID: <00bc01c55665$31117340$1400a8c0@tgusta2> Reply-To: "Ing. Jhon Carrillo" From: "Ing. Jhon Carrillo" To: Subject: how do i kill user sessions? Date: Wed, 11 May 2005 16:08:25 -0400 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_00B9_01C55643.A964CBC0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Virus-Scanned: ClamAV version 0.81, clamav-milter version 0.81b on rs26s12.datacenter.cha.cantv.net X-Virus-Status: Clean X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.028 tagged_above=0 required=5 tests=HTML_60_70, HTML_MESSAGE X-Spam-Level: X-Archive-Number: 200505/124 X-Sequence-Number: 17553 This is a multi-part message in MIME format. ------=_NextPart_000_00B9_01C55643.A964CBC0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have a problem with the users administration. When I want to erase = (drop) some databases there's an error: ** database "name_db" is being = accessed by other users.** I want to kill the user sessions conected = but i don't know how to do it (Kill the user sessions). thanks. ------=_NextPart_000_00B9_01C55643.A964CBC0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I have a problem  with the=20 users administration. When I want to erase (drop) some databases = there's an=20 error: ** database "name_db" is being accessed by = other=20 users.**  I want to kill the user = sessions conected=20 but i don't know how to do it   (Kill the user = sessions).
 
thanks.
------=_NextPart_000_00B9_01C55643.A964CBC0-- From smarlowe@g2switchworks.com Wed May 11 20:26:25 2005 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A3C1C52972 for ; Wed, 11 May 2005 17:26:25 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 82190-05 for ; Wed, 11 May 2005 20:26:24 +0000 (GMT) Received: from koolancexeon.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by svr1.postgresql.org (Postfix) with ESMTP id 216CE52951 for ; Wed, 11 May 2005 17:26:22 -0300 (ADT) Received: mail.g2switchworks.com 10.10.1.8 from 10.10.1.37 10.10.1.37 via HTTP with MS-WebStorage 6.5.6944 Received: from state.g2switchworks.com by mail.g2switchworks.com; 11 May 2005 15:26:23 -0500 Subject: Re: how do i kill user sessions? From: Scott Marlowe To: "Ing. Jhon Carrillo" Cc: pgsql-admin@postgresql.org In-Reply-To: <00bc01c55665$31117340$1400a8c0@tgusta2> References: <00bc01c55665$31117340$1400a8c0@tgusta2> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1115843183.3868.237.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Wed, 11 May 2005 15:26:23 -0500 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/126 X-Sequence-Number: 17555 On Wed, 2005-05-11 at 15:08, Ing. Jhon Carrillo wrote: > I have a problem with the users administration. When I want to erase > (drop) some databases there's an error: ** database "name_db" is being > accessed by other users.** I want to kill the user sessions conected > but i don't know how to do it (Kill the user sessions). First, use ps to find the pid of the offending users. for instance: ps ax|grep postgres|grep test 18925 pts/1 S 0:00 postgres: postgres test [local] idle then, as the postgres superuser, kill the backend: kill 18925 From cbbrowne@acm.org Wed May 11 23:13:07 2005 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A09CF53C8B for ; Wed, 11 May 2005 20:13:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 11593-03 for ; Wed, 11 May 2005 23:12:58 +0000 (GMT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by svr1.postgresql.org (Postfix) with ESMTP id DFCC653531 for ; Wed, 11 May 2005 20:12:57 -0300 (ADT) Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.13.1/8.13.1) with ESMTP id j4BNCvLQ012326 for ; Wed, 11 May 2005 23:12:57 GMT (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.13.1/8.13.1/Submit) id j4BN3xb8011043 for pgsql-admin@postgresql.org; Wed, 11 May 2005 23:03:59 GMT (envelope-from news) From: Chris Browne X-Newsgroups: pgsql.admin Subject: Re: how do i kill user sessions? Date: Wed, 11 May 2005 18:49:51 -0400 Organization: cbbrowne Computing Inc Lines: 36 Message-ID: <60ekcdtm28.fsf@dba2.int.libertyrms.com> References: <00bc01c55665$31117340$1400a8c0@tgusta2> <1115843183.3868.237.camel@state.g2switchworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@news.hub.org User-Agent: Gnus/5.1006 (Gnus v5.10.6) XEmacs/21.4 (Jumbo Shrimp, linux) Cancel-Lock: sha1:GfcZyDrqHgP/frPwprkKsQ7G0gc= To: pgsql-admin@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Archive-Number: 200505/141 X-Sequence-Number: 17570 smarlowe@g2switchworks.com (Scott Marlowe) writes: > On Wed, 2005-05-11 at 15:08, Ing. Jhon Carrillo wrote: >> I have a problem with the users administration. When I want to erase >> (drop) some databases there's an error: ** database "name_db" is being >> accessed by other users.** I want to kill the user sessions conected >> but i don't know how to do it (Kill the user sessions). > > First, use ps to find the pid of the offending users. for instance: > > ps ax|grep postgres|grep test > 18925 pts/1 S 0:00 postgres: postgres test [local] idle > > then, as the postgres superuser, kill the backend: > > kill 18925 You may want to be careful about what signal you submit. If you do "kill -9", for instance, that may be a more severe "thwacking" of the system than you intended. Hitting it with "kill -2" is usually the right answer; that's SIGINT. Other signals may cause the database to kill ALL the backends. "kill -3", for instance... "kill -9" will terminate the whole database system, 'with extreme prejudice,' which will be quite likely to turn out badly :-(. -- (format nil "~S@~S" "cbbrowne" "acm.org") http://www.ntlug.org/~cbbrowne/sap.html Rules of the Evil Overlord #78. "I will not tell my Legions of Terror "And he must be taken alive!" The command will be: ``And try to take him alive if it is reasonably practical.''" From smarlowe@g2switchworks.com Thu May 12 15:07:06 2005 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AE0D153544 for ; Thu, 12 May 2005 12:07:06 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 55441-09 for ; Thu, 12 May 2005 15:06:56 +0000 (GMT) Received: from koolancexeon.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by svr1.postgresql.org (Postfix) with ESMTP id C413753E11 for ; Thu, 12 May 2005 12:06:51 -0300 (ADT) Received: mail.g2switchworks.com 10.10.1.8 from 10.10.1.37 10.10.1.37 via HTTP with MS-WebStorage 6.5.6944 Received: from state.g2switchworks.com by mail.g2switchworks.com; 12 May 2005 10:06:49 -0500 Subject: Re: how do i kill user sessions? From: Scott Marlowe To: Chris Browne Cc: pgsql-admin@postgresql.org In-Reply-To: <60ekcdtm28.fsf@dba2.int.libertyrms.com> References: <00bc01c55665$31117340$1400a8c0@tgusta2> <1115843183.3868.237.camel@state.g2switchworks.com> <60ekcdtm28.fsf@dba2.int.libertyrms.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1115910409.3868.248.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 12 May 2005 10:06:49 -0500 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/146 X-Sequence-Number: 17575 On Wed, 2005-05-11 at 17:49, Chris Browne wrote: > smarlowe@g2switchworks.com (Scott Marlowe) writes: > > > On Wed, 2005-05-11 at 15:08, Ing. Jhon Carrillo wrote: > >> I have a problem with the users administration. When I want to erase > >> (drop) some databases there's an error: ** database "name_db" is being > >> accessed by other users.** I want to kill the user sessions conected > >> but i don't know how to do it (Kill the user sessions). > > > > First, use ps to find the pid of the offending users. for instance: > > > > ps ax|grep postgres|grep test > > 18925 pts/1 S 0:00 postgres: postgres test [local] idle > > > > then, as the postgres superuser, kill the backend: > > > > kill 18925 > > You may want to be careful about what signal you submit. > > If you do "kill -9", for instance, that may be a more severe > "thwacking" of the system than you intended. > > Hitting it with "kill -2" is usually the right answer; that's SIGINT. > > Other signals may cause the database to kill ALL the backends. > "kill -3", for instance... > > "kill -9" will terminate the whole database system, 'with extreme > prejudice,' which will be quite likely to turn out badly :-(. Not exactly. kill -9 on a single backend will not kill the whole database but WILL cause all backends to terminate and the database server to restart, which is rather severe. Also note that postgresql is designed to survive a kill -9 on all signals with aplomb, but a production system is definitely not the place to be testing it, eh? :) Also note that while most signal numbers are the same, it's a good idea to use the text name assigned, as they are always pretty much the same across different systems. Without specifying a specific signal, a TERM should be sent, which is a 15 on both Solaris and Linux and (I think) BSD. So, 'kill -s sigterm pidhere' is pretty much the same as 'kill pidhere'. From gourish@gmail.com Fri May 13 13:26:54 2005 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id A3F5C5294D for ; Fri, 13 May 2005 10:26:54 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 35745-03 for ; Fri, 13 May 2005 13:26:50 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.204]) by svr1.postgresql.org (Postfix) with ESMTP id 0F95B5378F for ; Fri, 13 May 2005 10:26:47 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id 12so1417823nzp for ; Fri, 13 May 2005 06:26:51 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=HxlJKjwga7pr++O/hdY589PCkMFpHOFrpLK90l9Or0MkRAyS8Bftj55CnoWRL5wemrHXKeBS3l7qi3pYKNDMOvybid6/M+OZpp+IGf6+vJHJs2xmoQtzQZwG2g8Xh1umtYFEWxeHjHLnGBqCJMl9+m0tsa+zRYTvxMGzKkft/oQ= Received: by 10.36.147.12 with SMTP id u12mr1038643nzd; Fri, 13 May 2005 06:26:51 -0700 (PDT) Received: by 10.36.74.10 with HTTP; Fri, 13 May 2005 06:26:51 -0700 (PDT) Message-ID: <674d1f8a05051306264754fbd0@mail.gmail.com> Date: Fri, 13 May 2005 18:56:51 +0530 From: Gourish Singbal Reply-To: Gourish Singbal To: "Ing. Jhon Carrillo" Subject: Re: how do i kill user sessions? Cc: pgsql-admin@postgresql.org In-Reply-To: <00bc01c55665$31117340$1400a8c0@tgusta2> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <00bc01c55665$31117340$1400a8c0@tgusta2> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.27 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, RCVD_BY_IP X-Spam-Level: X-Archive-Number: 200505/182 X-Sequence-Number: 17611 you can try. 1) ps -ef | grep "postgres" see which users are connectioned and than. 2) pkill -f 'postgres: postgres '; its more safer i suppose than kill -9 regards Gourish On 5/12/05, Ing. Jhon Carrillo wrote: > I have a problem with the users administration. When I want to erase (dr= op) > some databases there's an error: ** database "name_db" is being accessed = by > other users.** I want to kill the user sessions conected but i don't kno= w > how to do it (Kill the user sessions). > =20 > thanks. --=20 Best, Gourish Singbal From adave@vantage.com Fri May 13 14:37:01 2005 X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7E9BE565E7 for ; Fri, 13 May 2005 11:37:01 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49729-02 for ; Fri, 13 May 2005 14:36:56 +0000 (GMT) Received: from vt-pe2550-001.VANTAGE.vantage.com (vt-pe2550-001.vantage.com [64.80.203.244]) by svr1.postgresql.org (Postfix) with ESMTP id 27F12565A1 for ; Fri, 13 May 2005 11:36:54 -0300 (ADT) X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Re: how do i kill user sessions? Date: Fri, 13 May 2005 10:36:58 -0400 Message-ID: <4BAFBB6B9CC46F41B2AD7D9F4BBAF785026FF805@vt-pe2550-001.vantage.vantage.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [ADMIN] how do i kill user sessions? Thread-Index: AcVXwMO5bpvijir4Que5g+P6Tx0NwwACF7bg From: "Anjan Dave" To: "Gourish Singbal" , "Ing. Jhon Carrillo" Cc: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.051 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/184 X-Sequence-Number: 17613 Or,=20 Kill -s SIGINT Thanks, Anjan -----Original Message----- From: Gourish Singbal [mailto:gourish@gmail.com]=20 Sent: Friday, May 13, 2005 9:27 AM To: Ing. Jhon Carrillo Cc: pgsql-admin@postgresql.org Subject: Re: [ADMIN] how do i kill user sessions? you can try. 1) ps -ef | grep "postgres" see which users are connectioned and than. 2) pkill -f 'postgres: postgres '; its more safer i suppose than kill -9 regards Gourish On 5/12/05, Ing. Jhon Carrillo wrote: > I have a problem with the users administration. When I want to erase (drop) > some databases there's an error: ** database "name_db" is being accessed by > other users.** I want to kill the user sessions conected but i don't know > how to do it (Kill the user sessions). > =20 > thanks. --=20 Best, Gourish Singbal ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend