Received: from sss.pgh.pa.us ([192.204.191.242]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g0AM9nB44190 for ; Thu, 10 Jan 2002 17:09:49 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g0AM9eg23075; Thu, 10 Jan 2002 17:09:40 -0500 (EST) To: Wei Weng cc: Stephan Szabo , pgsql-sql@postgresql.org Subject: Re: Resources In-reply-to: <20020110153346.41367a49.wweng@kencast.com> References: <4423720517.20020110190329@indvalley.com> <20020110080801.G82370-100000@megazone23.bigpanda.com> <20020110153346.41367a49.wweng@kencast.com> Comments: In-reply-to Wei Weng message dated "Thu, 10 Jan 2002 15:33:46 -0500" Date: Thu, 10 Jan 2002 17:09:40 -0500 Message-ID: <23072.1010700580@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200201/125 X-Sequence-Number: 6214 Wei Weng writes: > I have a side question. How do I stop this kind of crazy query to suck up > my CPU power if it is fed by a database driver? (like ODBC, for example) > Since kill -9 postmaster is highly not recommended, can i do a > /sbin/service postgresql stop to force it to shut down? That would shut down the whole database, which is likely not what you want. The best way to cancel a runaway query is to cancel it, ie, send a cancel request from the client (cf. control-C in psql, dunno whether the ODBC driver supports this). If you are logged into the postgres or root account on the DB machine, you can get the same effect with "kill -INT pid-of-backend". (not pid-of-postmaster) regards, tom lane