Re: Killing a session in windows

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Howard Cole <howardnews(at)selestial(dot)com>
Cc: "'PgSql General'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Killing a session in windows
Date: 2007-12-22 02:44:38
Message-ID: 200712220244.lBM2icf00697@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Howard Cole wrote:
> > Wow, yea, I see that now, but it is alone a paragraph above. I updated
> > the text to:
> >
> > The <xref linkend="app-pg-ctl"> program provides a convenient
> > interface for sending these signals to shut down the server.
> > Alternatively, you can send the signal directly using
> > <command>kill</> on non-Windows systems.
> >
> >
> My documentation point is that in administering the service, I cannot
> drop a database if there is still an active connection. To drop a
> process in linux appears to be easy using "kill", but this does not seem
> to be the case in windows using taskkill. I would rather see some
> reference to killing rogue connections using pg_ctl in the "Managing
> Databases" chapter, and reference to it in "Destroying a Database" and
> "DROP DATABASE" documentation because this would be where I would first
> search for a solution when I had the problem.

Uh, well we have this TODO:

* Allow administrators to safely terminate individual sessions either
via an SQL function or SIGTERM

Lock table corruption following SIGTERM of an individual backend
has been reported in 8.0. A possible cause was fixed in 8.1, but
it is unknown whether other problems exist. This item mostly
requires additional testing rather than of writing any new code.

http://archives.postgresql.org/pgsql-hackers/2006-08/msg00174.php

so I am unsure how we would give such a capability on Windows when we
don't support it on Unix either.

> In the pg_ctl documentation, I would recommend explicitly stating that
> "pg_ctl kill -TERM pid" can be used to kill individual connections to a
> database in windows, because "taskkill" and "select pg_cancel_backend()"
> do not seem to always work (for me anyway) in windows. Also HUP and

Where do we say that about Unix in the pg_ctl manual?

> other signals mean nothing to a windows user.

We actually simulate these signals on Windows, so the pg_ctl kill
actually works just like Unix. We do have in the pg_ctl manual:

<option>kill</option> mode allows you to send a signal to a specified
process. This is particularly valuable for <productname>Microsoft Windows</>
which does not have a <application>kill</> command. Use
<literal>--help</> to see a list of supported signal names.

Is that unclear?

> In general the documentation, understandably, is geared toward *nix, I
> do not know what proportion of installations are Windows, but I suspect
> they are growing at a rapid rate since version 8. Postgres on Windows is
> a fabulous product, and the migration to the windows platform has been
> much cleaner than the migration of Mysql, so it would be a shame to lose
> market share on the basis that the documentation still has sections
> biased towards *nix. Removal of *nix-isms from the main strand of the
> documentation and additions of clearly marked build dependant comments
> where appropriate would make a big difference in uniting the world! So
> for example, the documentation for pg_ctl would have a description and
> common options, and then list any linux/bsd/unix/windows differences in
> section similar to the User Comments sections of the documentation.

Can you give a specific example? As I said we simulate Windows so it
should act just like Unix.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2007-12-22 03:03:29 Re: Setting Sequence Values
Previous Message Greg Smith 2007-12-22 02:40:45 Re: Setting Sequence Values