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.''"