Обсуждение: How to enumerate/drop user sessions in windows

Поиск
Список
Период
Сортировка

How to enumerate/drop user sessions in windows

От
Howard Cole
Дата:
Hi,

When trying to drop a database using psql connected to a windows server
running postgresql 8.0.3, I get the error message "Database X is being
accessed by other users."

Now when the Database server is running on a linux server, I can run ps
and pick the sessions that I want to kill. However how can I do this on
windows? Is there a psql command to kill sessions?

Thanks

Howard Cole
http://www.selestial.com

Re: How to enumerate/drop user sessions in windows

От
Oliver Fürst
Дата:
Hi,

On 31.01.2006 10:33, Howard Cole wrote:
> Now when the Database server is running on a linux server, I can run ps
> and pick the sessions that I want to kill. However how can I do this on
> windows? Is there a psql command to kill sessions?

As this is a bit hard to accomplish with Windows' own task manager, get
SysInternals free Process Explorer from here
http://www.sysinternals.com/Utilities/ProcessExplorer.html and after
starting it, use Find -> Find Handle (CTRL + F) and search for
"postgres:". This will give you a similar output like "ps aux|grep
postgres:" on Linux.

If you then select on of the shown processes it will select the right
process in the main window, where you can right click and select "Kill
process" (DEL).

Hope that helps.

Regards,
Oliver

Re: How to enumerate/drop user sessions in windows

От
Howard Cole
Дата:
Oliver Fürst wrote:

> As this is a bit hard to accomplish with Windows' own task manager,
> get SysInternals free Process Explorer from here
> http://www.sysinternals.com/Utilities/ProcessExplorer.html and after
> starting it, use Find -> Find Handle (CTRL + F) and search for
> "postgres:". This will give you a similar output like "ps aux|grep
> postgres:" on Linux.
>
> If you then select on of the shown processes it will select the right
> process in the main window, where you can right click and select "Kill
> process" (DEL).
>
Thanks Oliver,

I can see that this would probably work because I have used the
SysInternals' Process Explorer before.

It would be great if this could be done using the standard tools (psql
for example). I was hoping that such an command existed.