How to enumerate/drop user sessions in windows

Started by Howard Coleabout 20 years ago3 messagesgeneral
Jump to latest
#1Howard Cole
howardnews@selestial.com

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

#2Oliver Fürst
ofuerst@tsak.net
In reply to: Howard Cole (#1)
Re: How to enumerate/drop user sessions in windows

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

#3Howard Cole
howardnews@selestial.com
In reply to: Oliver Fürst (#2)
Re: How to enumerate/drop user sessions in windows

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.