Received: from makus.postgresql.org ([98.129.198.125]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T7ClG-00052q-SG for pgsql-docs@postgresql.org; Thu, 30 Aug 2012 21:58:51 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T7ClF-0007P6-9F for pgsql-docs@postgresql.org; Thu, 30 Aug 2012 21:58:50 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1T7ClE-0001OJ-Oj; Thu, 30 Aug 2012 17:58:48 -0400 Date: Thu, 30 Aug 2012 17:58:48 -0400 From: Bruce Momjian To: Josh Kupershmidt Cc: pgsql-docs Subject: Re: Out of date advice about SIGTERM'ing backends Message-ID: <20120830215848.GD32350@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-Pg-Spam-Score: -2.1 (--) X-Archive-Number: 201208/56 X-Sequence-Number: 7449 On Fri, Jun 29, 2012 at 08:10:40PM -0700, Josh Kupershmidt wrote: > Hi all, > > In the "Notes" section[0] of the postgres command's page, this advice is given: > > | The postgres server uses SIGTERM to tell subordinate server > | processes to quit normally and SIGQUIT to terminate without > | the normal cleanup. These signals should not be used by users. > > I think now that we've added pg_terminate_backend() and made it > callable by non-superusers, we should relax the caveat against using > SIGTERM against backends. The warning to stay away from using SIGQUIT > seems fine as-is. Patch attached. Patch applied for 9.3. --------------------------------------------------------------------------- > > Josh > > [0] http://www.postgresql.org/docs/9.2/static/app-postgres.html#AEN87192 > diff --git a/doc/src/sgml/ref/postgres-ref.sgml b/doc/src/sgml/ref/postgres-ref.sgml > new file mode 100644 > index 4e5cd02..a1d014d > *** a/doc/src/sgml/ref/postgres-ref.sgml > --- b/doc/src/sgml/ref/postgres-ref.sgml > *************** PostgreSQL documentation > *** 726,739 **** > > > To cancel a running query, send the SIGINT signal > ! to the process running that command. > > > > ! The postgres server uses SIGTERM > ! to tell subordinate server processes to quit normally and > ! SIGQUIT to terminate without the normal cleanup. > ! These signals should not be used by users. It > is also unwise to send SIGKILL to a server > process — the main postgres process will > interpret this as a crash and will force all the sibling processes > --- 726,743 ---- > > > To cancel a running query, send the SIGINT signal > ! to the process running that command. To terminate a backend process > ! cleanly, send SIGTERM to that process. See > ! also pg_cancel_backend and pg_terminate_backend > ! in for the SQL-callable equivalents > ! of these two actions. > > > > ! The postgres server uses SIGQUIT > ! to tell subordinate server processes to terminate without normal > ! cleanup. > ! This signal should not be used by users. It > is also unwise to send SIGKILL to a server > process — the main postgres process will > interpret this as a crash and will force all the sibling processes > > -- > Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-docs -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. +