X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 68AFD475F26 for ; Wed, 26 Mar 2003 07:18:19 -0500 (EST) Received: from mail02.infosat.net (ananzi02.mx.smtphost.net [196.38.110.4]) by postgresql.org (Postfix) with ESMTP id 6D3DE476311 for ; Wed, 26 Mar 2003 07:18:12 -0500 (EST) Received: from [196.38.110.24] (HELO mail01.infosat.net) by mail02.infosat.net (CommuniGate Pro SMTP 3.5.9) with ESMTP id 94441435 for pgsql-sql@postgresql.org; Wed, 26 Mar 2003 14:18:13 +0200 To: pgsql-sql@postgresql.org Date: Wed, 26 Mar 2003 14:18:13 +0200 Message-ID: From: "Stefan Berg" Subject: Database not restarting X-Original-To: pgsql-admin@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.5.9 X-Original-Date: Wed, 26 Mar 2003 12:00:06 +0200 X-Original-Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-5.8 required=5.0 tests=BAYES_10 version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200303/600 X-Sequence-Number: 12638 Hi list, Having a problem shutting down a database (ver 7.3.1) I basically restart a certain database every night because it always used to be the easy solution, to get rid of unwanted zombie connections, left by people who close front end aps by switching off their computers. The problem now is, that with one big database, these type of runnaway processes actually keeps the database from shutting down. I initiate all this by killing the postmaster (kill -15), I then get these nice logs : 2003-03-23 17:30:01 LOG: smart shutdown request 2003-03-23 17:30:01 LOG: shutting down 2003-03-23 17:30:02 LOG: connection received: host=3Dbubba port=3D3400000 2003-03-23 17:30:02 FATAL: The database system is shutting down 2003-03-23 17:30:04 LOG: recycled transaction log file 00000052000000A0 2003-03-23 17:30:04 LOG: recycled transaction log file 00000052000000A1 2003-03-23 17:30:04 LOG: recycled transaction log file 00000052000000A2 2003-03-23 17:30:04 LOG: removing transaction log file 00000052000000A3 2003-03-23 17:30:04 LOG: removing transaction log file 00000052000000A4 2003-03-23 17:30:04 LOG: removing transaction log file 00000052000000A5 2003-03-23 17:30:04 LOG: removing transaction log file 00000052000000A6 2003-03-23 17:30:04 LOG: database system is shut down 2003-03-25 18:01:14 LOG: database system was shut down at 2003-03-25 18:00:54 SAST OK, the fictional host trying to connect, is a script I wrote to check if the database has been shut down or not. You can see my problem between 17:30:04 and 18:01:14 This was caused by some stray idle connection that I just killed (-15), and then the database finally shut down. My current script attempt to kill this kind of stray process, is making me scared. Now my question: Can anyone give some advise on an elegant way to shut down the database properly. In my case, I don't worry or care if someone was still busy on the database, because nobody updates stuff. Any help will be appreciated. Stef=20 =20 =3D=3D Download ringtones, logos and picture messages at Ananzi Mobile Fun. http://www.ananzi.co.za/cgi-bin/goto.pl?mobile