Re: Find the Person Connected to a Database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Milen A. Radev" <milen@xxxxxxxxx> writes:
> Naomi Walker íàïèñà:
>> I'm trying to drop a database in a postgres 8.1.4 instance (x86 Solaris 
>> 10 OS),  but someone is connected to
>> the database.  What is the best way to find out exactly who is connected?

> select * from pg_stat_activity where datname = <the_db_about_to_be_dropped>;

If that doesn't work because you've got stats collection turned off,
"ps" will help too:

http://www.postgresql.org/docs/8.1/static/monitoring.html

On Solaris, note the Tip at the bottom (not sure if it applies to recent
Solaris versions but a few years ago it was critical).

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

               http://archives.postgresql.org

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux