How can I see which users are connected?

Started by Jacob Vennervald Madsenabout 24 years ago2 messagesgeneral
Jump to latest
#1Jacob Vennervald Madsen
jvm@gopinocchio.com

Hi List

I'm trying to drop a database but I get this error:
ERROR: DROP DATABASE: database "mydb" is being accessed by other users

How can I see which user that is and from where he is connected?

Jacob

#2Fran Fabrizio
ffabrizio@mmrd.com
In reply to: Jacob Vennervald Madsen (#1)
Re: How can I see which users are connected?

Jacob Vennervald Madsen wrote:

Hi List

I'm trying to drop a database but I get this error:
ERROR: DROP DATABASE: database "mydb" is being accessed by other users

How can I see which user that is and from where he is connected?

I'm not so sure about the user, but a regular old 'ps -ax' will show you
what IP the connections are coming from, and what query they're running.

-Fran